gpt4 book ai didi

audio - 如何使用gst-launch播放原始音频文件?

转载 作者:行者123 更新时间:2023-12-02 23:47:43 24 4
gpt4 key购买 nike

我正在使用gst-launch-0.10。

我使用以下命令从mp3文件创建了一个pcm文件(至少,我想我有):

gst-launch-0.10 filesrc location=my-sound.mp3 ! mad ! audioresample ! audioconvert ! 'audio/x-raw-int, rate=8000, channels=1, endianness=4321, width=16, depth=16, signed=true' ! filesink location=out.raw

我现在有一个out.raw文件。

为了测试一切是否正常,我想回放一下。
我尝试了这个(除其他外):
gst-launch-0.10 filesrc location=out.raw  ! capsfilter caps="audio/x-raw-int, rate=8000, channels=1, endianness=4321, width=16, depth=16, signed=true" ! alsasink can-activate-pull=true

但我每次都会收到此错误:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: Filter caps do not completely specify the output format
Additional debug info:
gstcapsfilter.c(393): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:
Output caps are unfixed: EMPTY
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

“过滤帽没有完全指定输出格式”?这里缺少什么?

最佳答案

好吧,在audioconvert使它起作用之前添加alsasink过滤器。根据gst-inspect,指定的音频格式与alsa兼容。所以我想这是声卡的问题,而且audioconvert以某种方式将数据转换为我的声卡可以处理的数据。只是一个猜测。

我还删除了can-activate-pull=true选项。启用此选项的声音质量非常差。我想了解原因。

关于audio - 如何使用gst-launch播放原始音频文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29276078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com