首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用gstreamer和脉冲音频播放opus文件

使用gstreamer和脉冲音频播放opus文件
EN

Stack Overflow用户
提问于 2022-01-11 19:58:00
回答 1查看 344关注 0票数 -1

我无法找到一个gst-launch调用来简单地播放一个opus文件到脉冲音频。有什么帮助吗?

我试过的东西

代码语言:javascript
复制
130 % file foo.opus
foo.opus: Ogg data, Opus audio, version 0.1, stereo, 44100 Hz (Input Sample Rate)

0 % gst-launch-1.0 filesrc location=foo.opus ! pulsesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstPulseSink:pulsesink0: The stream is in the wrong format.

1 % gst-launch-1.0 filesrc location=foo.opus ! opusparse ! pulsesink
WARNING: erroneous pipeline: could not link opusparse0 to pulsesink0

1 % gst-launch-1.0 filesrc location=foo.opus ! opusdec ! pulsesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data stream error.

# this runs, but only makes one burst of noise
0 % gst-launch-1.0 filesrc location=foo.opus ! opusparse ! opusdec ! pulsesink
EN

回答 1

Stack Overflow用户

发布于 2022-01-12 02:03:29

下面是一个有用的例子。

代码语言:javascript
复制
gst-launch-1.0 filesrc location=foo.opus ! oggdemux ! opusparse ! opusdec ! alsasink

我能够从这里的管道示例中把这些拼凑在一起

https://gstreamer.freedesktop.org/documentation/opus/opusdec.html?gi-language=c

https://gstreamer.freedesktop.org/documentation/opus/opusenc.html?gi-language=c

尽管在这些例子中没有opusparse。我不知道为什么我的文件需要opusparse,但是用opusenc创建的sine.ogg不需要它。或者解析和解码opus文件数据有什么区别.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70672729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档