0

I was following the guide here How to play a PCM data array with GStreamer step by step (Florian Zwoch's solution). However, there is no sound output from gstreamer.

I am using windows and installed gstreamer through msys2 along with various gstreamer plugins. I can compile and run gstreamer's basic tutorial (https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html?gi-language=c) so I believe this is not a Gstreamer installation problem.

What should I do to solve the problem?

Update1: using Sudhir Kesti's suggestion gst-launch-1.0.exe filesrc location=D:\Work\command-post\mix_1.pcm ! rawaudioparse num-channels=1 sample-rate=8000 pcm-format=GST_AUDIO_FORMAT_S16LE ! audioconvert ! audioresample ! autoaudiosink --gst-debug=2,I am able to play. However, I am still unable to query the duration of the pipeline or use gst_element_seek_simple. How to query the duration or seek the position of the pipeline?

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Mar 10 '23 at 18:43

1 Answers1

0

You need rawaudioparse to bundle audiosamples into frames. Add audioconvert and audioresample to convert pcm to the desired format. Set channel, format, and rate as per the pcm data.

gst-launch-1.0.exe filesrc location=D:\Work\command-post\mix_1.pcm ! rawaudioparse num-channels=1 sample-rate=8000 pcm-format=GST_AUDIO_FORMAT_S16LE ! audioconvert ! audioresample ! autoaudiosink --gst-debug=2

Use gst_parse_launch() for sample application.

  • Thank you for your suggestion! Now I can play the pcm. However, I am still unable to query the duration of the pipeline or use gst_element_seek_simple. I would be grateful if you know any way to solve this. Thank you! – bkehufi3evsd Mar 11 '23 at 04:12
  • https://stackoverflow.com/questions/75713403/gstreamer-cannot-adjust-volume-of-pipeline-while-playing-cannot-seek-to-time-c Please help me on this! I really need your help thank you in advance! – bkehufi3evsd Mar 12 '23 at 13:23