【发布时间】:2019-09-04 04:25:12
【问题描述】:
我正在尝试使用 Qt 和 C++ 播放 WAV 音频文件,它失败了,然后我尝试使用 gst-launch-1.0 播放它,它也失败了。这都是使用 armv7 工具链并在 QEMU 下运行。
使用代码在 C++ 中失败后
QAudioDecoder decoder;
QFileInfo fileInfo(WAV_FILE_NAME);
decoder.setSourceFilename(fileInfo.absoluteFilePath());
decoder.start();
if (decoder.state() == QAudioDecoder::DecodingState)
qDebug() << "Decoding";
失败并出现错误
0:00:00.167441195 29283 0xf375dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.176093619 29283 0xf375dc00 WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.237290158 29283 0xf37fc660 WARN uridecodebin gsturidecodebin.c:921:unknown_type_cb:<uridecodebin0> warning: No decoder available for type 'audio/x-wav'.
0:00:00.238382698 29283 0xf37fc660 WARN decodebin gstdecodebin2.c:4640:gst_decode_bin_expose:<decodebin0> error: no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
0:00:00.239083745 29283 0xf37fc660 WARN uridecodebin gsturidecodebin.c:988:no_more_pads_full:<uridecodebin0> error: no suitable plugins found:
../../../gst-plugins-base-1.14.4/gst/playback/gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPlayBin:playbin1/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
0:00:00.240739264 29283 0xf37fc660 WARN typefind gsttypefindelement.c:1231:gst_type_find_element_loop:<typefind> error: Internal data stream error.
0:00:00.240853974 29283 0xf37fc660 WARN typefind gsttypefindelement.c:1231:gst_type_find_element_loop:<typefind> error: streaming stopped, reason not-linked (-1)
这就是我尝试使用的原因
./gst-launch-1.0 -v uridecodebin uri=file:///home/vbox/myaudio.wav
然后我也收到了这个错误
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/x-wav
Missing element: WAV demuxer
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'audio/x-wav'.
Additional debug info:
../../../gst-plugins-base-1.14.4/gst/playback/gsturidecodebin.c(921): unknown_type_cb (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
../../../gst-plugins-base-1.14.4/gst/playback/gsturidecodebin.c(988): no_more_pads_full (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
../../../gst-plugins-base-1.14.4/gst/playback/gstdecodebin2.c(4640): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
我不确定真正缺少什么。另外,这是 gst-inspect-1.0 的输出
$> ./gst-inspect-1.0 | grep wav
audiovisualizers: wavescope: Waveform oscilloscope
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: audio/x-wav: wav
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-wavpack-correction: wvc
这里可能缺少什么?
【问题讨论】:
-
我猜
wavparse: wavparse: WAV audio demuxer是必需的,如果不是更多的话。取决于您的 .wav 文件。我会检查您的安装是否有其他软件包。
标签: c++ qt audio arm gstreamer