# Audio use cases The audio GStreamer use cases show capture of audio from a file source and playback of the audio stream on a speaker. Before you run the use cases, ensure that you complete the preconditions mentioned in [GStreamer command-line use cases](https://docs.qualcomm.com/doc/80-80021-50/topic/gstreamer-application-use-cases.html). ## Audio (only) capture The use cases show how to capture the PCM audio streams and store them in a file. - Run all the commands in the SSH shell of the target device. - To stop the use case, use **CTRL + C**. ### Single PCM capture gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! wavenc ! filesink location=/opt/.wav Copy to clipboard Open source GST BIN pulsesrc audioconvert wavenc filesink **Figure : Pipeline for audio capture with PCM encode** ### Single FLAC capture gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! flacenc ! filesink location=/opt/.flac Copy to clipboard Open source GST BIN pulsesrc audioconvert flacenc filesink **Figure : Pipeline for the audio capture with FLAC encode** ## Audio (only) playback The pipelines show the use cases for playback of single audio streams on a speaker. - Run all the commands in the SSH shell of the target device. - To stop the use case, use **CTRL + C**. ### Single PCM playback gst-launch-1.0 -e filesrc location=/opt/.wav ! wavparse ! audioconvert ! pulsesink volume=10 Copy to clipboard The pipeline shows a single WAV stream taken from a file source and played on a speaker. Open source GST BIN filesrc wavparse audioconvert pulsesink **Figure : Pipeline for WAV stream playback** ### Single MP2/MP3 playback - MP2 gst-launch-1.0 -e filesrc location=/opt/.mp2 ! mpegaudioparse ! mpg123audiodec ! pulsesink volume=10 Copy to clipboard - MP3 gst-launch-1.0 -e filesrc location=/opt/.mp3 ! mpegaudioparse ! mpg123audiodec ! pulsesink volume=10 Copy to clipboard The pipeline shows a single MP2 stream taken from a file source and played on a speaker. Open source GST BIN filesrc mpegaudioparse mpg123audiodec pulsesink **Figure : Pipeline for MP2/MP3 stream playback** ### Single FLAC playback gst-launch-1.0 -e filesrc location=/opt/.flac ! flacparse ! flacdec ! pulsesink volume=10 Copy to clipboard The pipeline shows a single FLAC stream taken from a file source and played on a speaker. Open source GST BIN filesrc flacparse flacdec pulsesink **Figure : Pipeline for FLAC stream playback** ### Single OGG playback gst-launch-1.0 -e filesrc location=/opt/.ogg ! oggdemux ! vorbisdec ! audioconvert ! pulsesink volume=10 Copy to clipboard The pipeline shows a single OGG stream taken from a file source and played on a speaker. Open source GST BIN filesrc oggdemux vorbisdec audioconvert pulsesink **Figure : Pipeline for OGG stream playback** ### Related information - [Audio playback](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-audio-decode-sample.html) - [Audio recording](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-audio-encode-example-without-flac.html) Last Published: Mar 26, 2026 [Previous Topic Video playback use cases](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/video-playback-use-cases.md) [Next Topic Audio-video use cases](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/audio-video-use-cases.md)