-1

I cannot figure out an gst-launch invocation to simply play an opus file to pulseaudio. Any help?

Things I've tried

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
Todd Freed
  • 877
  • 6
  • 19

1 Answers1

0

Here is a working example.

gst-launch-1.0 filesrc location=foo.opus ! oggdemux ! opusparse ! opusdec ! alsasink

I was able to piece this together from the example pipelines here

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

and

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

Although, in those examples, there is no opusparse. I don't know why opusparse is needed for my files, but it isn't needed for sine.ogg created with opusenc. Or what the difference is between parsing and decoding the opus file data ...

Todd Freed
  • 877
  • 6
  • 19