使用以下工作正常
gst-launch-0.10 filesrc location=temp.wav ! wavparse ! audioconvert ! alsasink device=hw:0
和
一样gst-launch-1.0 filesrc location=temp.wav ! wavparse ! audioconvert ! alsasink device=hw:0
当我使用hw:2时,如果播放器正在使用它,则会出现设备忙碌错误,否则会出现内部数据流错误。
如果我启用调试
GST_DEBUG=2
我得到以下
alsa pcm_hw.c:1693:_snd_pcm_hw_open: alsalib error: Invalid value for card
basetransform gstbasetransform.c:1414:gst_base_transform_setcaps:<audioconvert0> transform could not transform audio/x-raw, format=(string)S16LE, layout=(string)interleaved, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, rate=(int)44100 in anything we support
basetransform gstbasetransform.c:1414:gst_base_transform_setcaps:<audioconvert0> transform could not transform audio/x-raw, format=(string)S16LE, layout=(string)interleaved, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, rate=(int)44100 in anything we support
basetransform gstbasetransform.c:1414:gst_base_transform_setcaps:<audioconvert0> transform could not transform audio/x-raw, format=(string)S16LE, layout=(string)interleaved, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, rate=(int)44100 in anything we support
basetransform gstbasetransform.c:1414:gst_base_transform_setcaps:<audioconvert0> transform could not transform audio/x-raw, format=(string)S16LE, layout=(string)interleaved, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, rate=(int)44100 in anything we support
wavparse gstwavparse.c:2249:gst_wavparse_loop:<wavparse0> error: Internal data flow error.
wavparse gstwavparse.c:2249:gst_wavparse_loop:<wavparse0> error: streaming task paused, reason not-negotiated (-4)
basetransform gstbasetransform.c:1414:gst_base_transform_setcaps:<audioconvert0> transform could not transform audio/x-raw, format=(string)S16LE, layout=(string)interleaved, channels=(int)2, channel-mask=(bitmask)0x0000000000000003, rate=(int)44100 in anything we support
ERROR: from element /GstPipeline:pipeline0/GstWavParse:wavparse0: Internal data flow error.
我从以下两个中获得声音
gst123 -a alsa=hw:2 temp.wav
aplay -D hw:2 temp.wav
我是否遗漏了gst-launch的其他参数?
非常感谢任何帮助!
答案 0 :(得分:0)
在写下问题时,我找到了答案,但我想我会继续发布问题以防其他人遇到同样的问题。确实有一个缺失的论点...... audioresample。
gst-launch-1.0 filesrc location=temp.wav ! wavparse ! audioconvert ! audioresample ! alsasink device=hw:2