# Audio playback

Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-decode-sample.html](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-decode-sample.html)

The **gst-audio-decode-example** application demonstrates the playback of audio
        files in WAV, MP3, and FLAC formats. Separate pipelines for each audio format ensure
        efficient processing and compatibility.

This sample application provides a basic template that can be extended and adapted.

The following figure shows the pipeline, which reads and parses the audio file, and then
            decodes and plays the audio. For information about the plugins used in the pipeline, see
                [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-audio-decode-sample.html#gst-audio-decode-sample__section_ovq_ywt_4bc).

Figure : gst-audio-decode-example pipeline
            
            <?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" width="817.985313415527344" height="370.664669036865234" viewbox="0 0 817.985313415527344 370.664669036865234">
  <g>
    <rect x=".499839782714844" y=".500118255615234" width="816.9853515625" height="369.66455078125" rx="7.499999999999916" ry="7.499999999999916" style="fill: #fafafa;"></rect>
    <path d="M809.985313415527344,1c3.85980224609375,0,7,3.140220642089844,7,7v354.664669036865234c0,3.859771728515625-3.14019775390625,7-7,7H8c-3.859779357910156,0-7-3.140228271484375-7-7V8c0-3.859779357910156,3.140220642089844-7,7-7h801.985313415527344M809.985313415527344,0H8C3.581779479980469,0,0,3.5816650390625,0,8v354.664669036865234c0,4.418334960938409,3.581779479980469,8,8,8h801.985313415527344c4.41827392578125,0,8-3.581665039061591,8-8V8c0-4.4183349609375-3.58172607421875-8-8-8h0Z" style="fill: #d2d7e1;"></path>
  </g>
  <g>
    <g>
      <g>
        <line x1="539.721763610839844" y1="69.088001251219794" x2="563.980796813964844" y2="69.088001251219794" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="562.813591003417969 73.077068328857422 569.721763610839844 69.088001251219794 562.813591003417969 65.098941802978516 562.813591003417969 73.077068328857422"></polygon>
      </g>
      <text transform="translate(417.542015075683594 31.890314219985157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mpg123audiodec</tspan></text>
      <rect x="419.721771560729394" y="39.08800812248046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(452.737327575683594 73.68342029908672)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Decode</tspan></text>
      <text transform="translate(596.627098083496094 31.890314219985157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">pulsesink</tspan></text>
      <rect x="570.365428399119992" y="39.08800812248046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(598.158348083496094 73.76368152955547)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Playback</tspan></text>
      <text transform="translate(596.627098083496094 145.59394276002422)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">pulsesink</tspan></text>
      <rect x="570.365428399119992" y="152.79162140373046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(598.158348083496094 187.467287181410939)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Playback</tspan></text>
      <g>
        <line x1="539.721763610839844" y1="296.495235443115234" x2="563.980796813964844" y2="296.495235443115234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="562.813591003417969 300.484310150146484 569.721763610839844 296.495235443115234 562.813591003417969 292.506160736083984 562.813591003417969 300.484310150146484"></polygon>
      </g>
      <text transform="translate(453.526390075683594 259.297540782485157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">flacdec</tspan></text>
      <rect x="419.721771560729394" y="266.49523468498046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(452.737327575683594 301.090641139540821)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Decode</tspan></text>
      <g>
        <line x1="389.721763610839844" y1="69.088001251219794" x2="413.980796813964844" y2="69.088001251219794" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="412.813591003417969 73.077068328857422 419.721763610839844 69.088001251219794 412.813591003417969 65.098941802978516 412.813591003417969 73.077068328857422"></polygon>
      </g>
      <text transform="translate(269.807640075683594 31.890314219985157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mpegaudioparse</tspan></text>
      <rect x="269.721771560729394" y="39.08800812248046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(309.252952575683594 73.68342029908672)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Parse</tspan></text>
      <g>
        <line x1="389.721763610839844" y1="182.791622161865234" x2="564.624443054199219" y2="182.791622161865234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="563.457237243652344 186.780681610107422 570.365440368652344 182.791622161865234 563.457237243652344 178.802547454833984 563.457237243652344 186.780681610107422"></polygon>
      </g>
      <text transform="translate(295.573265075683594 145.59394276002422)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">wavparse</tspan></text>
      <rect x="269.721771560729394" y="152.79162140373046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(309.252952575683594 187.387041209731251)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Parse</tspan></text>
      <g>
        <line x1="389.721763610839844" y1="296.495235443115234" x2="413.980796813964844" y2="296.495235443115234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="412.813591003417969 300.484310150146484 419.721763610839844 296.495235443115234 412.813591003417969 292.506160736083984 412.813591003417969 300.484310150146484"></polygon>
      </g>
      <text transform="translate(296.553733825683594 259.297540782485157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">flacparse</tspan></text>
      <rect x="269.721771560729394" y="266.49523468498046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(309.252952575683594 301.090641139540821)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Parse</tspan></text>
      <g>
        <line x1="239.721778869628906" y1="69.088001251219794" x2="263.980781555175781" y2="69.088001251219794" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="262.813591003417969 73.077068328857422 269.721778869628906 69.088001251219794 262.813591003417969 65.098941802978516 262.813591003417969 73.077068328857422"></polygon>
      </g>
      <text transform="translate(139.831092834472656 31.890314219985157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mp3 filesrc</tspan></text>
      <rect x="119.721771560730303" y="39.08800812248046" width="119.999999999999091" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(134.182655334472656 73.68342029908672)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Data capture</tspan></text>
      <g>
        <line x1="239.721778869628906" y1="182.791622161865234" x2="263.980781555175781" y2="182.791622161865234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="262.813591003417969 186.780681610107422 269.721778869628906 182.791622161865234 262.813591003417969 178.802547454833984 262.813591003417969 186.780681610107422"></polygon>
      </g>
      <text transform="translate(141.584999084472656 145.59394276002422)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">wav filesrc</tspan></text>
      <rect x="119.721771560730303" y="152.79162140373046" width="119.999999999999091" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(134.182655334472656 187.467104075942189)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Data capture</tspan></text>
      <g>
        <line x1="239.721778869628906" y1="296.495235443115234" x2="263.980781555175781" y2="296.495235443115234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="262.813591003417969 300.484310150146484 269.721778869628906 296.495235443115234 262.813591003417969 292.506160736083984 262.813591003417969 300.484310150146484"></polygon>
      </g>
      <text transform="translate(157.803749084472656 259.297540782485157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">filesrc</tspan></text>
      <rect x="119.721771560730303" y="266.49523468498046" width="119.999999999999091" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(134.182655334472656 301.090641139540821)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Data capture</tspan></text>
      <text transform="translate(596.627098083496094 259.297540782485157)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">pulsesink</tspan></text>
      <rect x="570.365428399119992" y="266.49523468498046" width="120" height="59.999992741379174" rx="3.999999516090611" ry="3.999999516090611" style="fill: #007884;"></rect>
      <text transform="translate(598.158348083496094 301.170910953078419)" style="fill: #fff; font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">Playback</tspan></text>
      <text transform="translate(32.826805114746094 150.458057403564453)" style="font-family: Roboto-Regular, Roboto; font-size: 16px;"><tspan x="0" y="0">mp3</tspan><tspan x="3.5078125" y="21">wav</tspan><tspan x="5.46875" y="42">flac</tspan><tspan x="-13.2265625" y="63">i/p file</tspan></text>
      <g>
        <line x1="69.920658111572266" y1="182.791622161865234" x2="113.980787515640259" y2="182.791622161865234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="112.813595533370972 186.780681610107422 119.721771240234375 182.791622161865234 112.813595533370972 178.802547454833984 112.813595533370972 186.780681610107422"></polygon>
      </g>
      <polyline points="119.721771560730303 69.088004493169137 82.854887286819576 69.088004493169137 82.854887286819576 298.78452577538701 119.721771560730303 298.78452577538701" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
      <g>
        <line x1="691.422996520996094" y1="182.791622161865234" x2="755.979331970214844" y2="182.791622161865234" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></line>
        <polygon points="754.812156677246094 186.780681610107422 761.720359802246094 182.791622161865234 754.812156677246094 178.802547454833984 754.812156677246094 186.780681610107422"></polygon>
      </g>
      <polyline points="690.451618077000603 296.495231055670956 713.234862184697704 296.495231055670956 713.234862184697704 69.088004493170956 690.451618077000603 69.088004493170956" style="fill: none; stroke: #000; stroke-miterlimit: 10;"></polyline>
      <g>
        <path d="M780.177847739596473,171.113262823053446c-.000900265044038-.622974256121779-.506650857027125-1.127264587685204-1.129625113149814-1.126363941171803-.298198300468357.000431059110269-.584093487275823.118923868081765-.795167493575718.32956681527503l-5.414378613168083,5.412778735370011c-.422061800782103.424586357592489-.996523215009802.66255234890923-1.5951941295898.660797595008262h-3.865584754359588c-.883652103486384,0-1.599993762982194.716340896557995-1.599993762982194,1.599993762980375v9.599962577884071c0,.88365286642329.716341659495811,1.599993762980375,1.599993762982194,1.599993762980375h3.865584754359588c.598670914579998-.001754753902787,1.173132328807696.236211237415773,1.5951941295898.660797595009171l5.412777972433105,5.414380139039167c.440075493992481.440943715705544,1.154281694281963.441645617267568,1.595225409986597.001571649147081.212407619266742-.211989530077517.331585926665866-.499875981095101.331167837473913-.799969415777014v-23.353509275744727Z" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
        <path d="M788.177816554500168,177.990035790515321c2.133326034556376,2.844433186868628,2.133326034556376,6.755529391016353,0,9.599962577884071" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
        <path d="M793.560196085862117,192.972377899759522c5.623562062875862-5.623493398588835,5.623616994300392-14.741034456148554.000125121583551-20.364595756085691-.000042724444938-.000041198572035-.000082397142251-.000083160077338-.000125121583551-.000124358646644" style="fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2px;"></path>
      </g>
    </g>
    <g>
      <text transform="translate(719.288078308105469 348.552837371826172)" style="font-family: Roboto-Regular, Roboto; font-size: 14px;"><tspan x="0" y="0">Open source</tspan></text>
      <rect x="699.037042915577331" y="336.461341881894441" width="16" height="16" rx="2" ry="2" style="fill: #007884;"></rect>
    </g>
  </g>
</svg>

## Run the application

1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70022-50/topic/mm_sample_apps_prerequisites.html).
2. Input at least one of the `<filename>.mp3`,
                        `<filename>.WAV`, or `<filename>.FLAC`
                    audio files on the target device.
3. In the terminal of the target device, use the following command to run the
                    application for different audio formats:

        gst-audio-decode-example -i /etc/media/<filename> --audio_format=<format>Copy to clipboard

The following table provides a description of the command-line
                            parameters:    | Command-line parameter | Description |
    | --- | --- |
    | `-i` | Specifies the absolute path to the input audio file to<br>                                        decode |
    | `--audio_format` | Specifies the format of the audio file:<ul class="ul" id="gst-audio-decode-sample__ul_efb_yxt_4bc"><br>                                            <li class="li"><code class="ph codeph">1</code> = MP3</li><br><br>                                            <li class="li"><code class="ph codeph">2</code> = WAV</li><br><br>                                            <li class="li"><code class="ph codeph">3</code> = FLAC</li><br><br>                                        </ul> |

    For example, use the following commands to run the application for
                        MP3, WAV, or FLAC audio formats:

    - Decode
                            MP3:

            gst-audio-decode-example -i /etc/media/<filename>.mp3 --audio_format=1Copy to clipboard
    - Decode
                            WAV:

            gst-audio-decode-example -i /etc/media/<filename>.wav --audio_format=2    Copy to clipboard
    - Decode
                            FLAC:

            gst-audio-decode-example -i /etc/media/<filename>.flac --audio_format=3Copy to clipboard
4. To stop the use case, use CTRL +
                    C.
5. In the terminal of the target device, run the following command in the SSH shell
                    to display the available help
                    options:

        gst-audio-decode-example --helpCopy to clipboard

## Expected output

Based on the format (MP3, WAV, FLAC), the decoded audio file is played back.

## Pipeline flow

The following table lists the plugins used to run the audio decode
                        pipeline:| Plugin | Description |
| --- | --- |
| filesrc | Reads the audio files. |
| <ul class="ul" id="gst-audio-decode-sample__ul_ezt_lxt_4bc"><br>                                        <li class="li">mpegaudioparse</li><br><br>                                        <li class="li">wavparse</li><br><br>                                        <li class="li">flacparse</li><br><br>                                    </ul> | Parses the MPEG, WAV, and FLAC audio files<br>                                    respectively. |
| <ul class="ul" id="gst-audio-decode-sample__ul_zgb_4xt_4bc"><br>                                        <li class="li">mpg123audiodec</li><br><br>                                        <li class="li">flacdec</li><br><br>                                    </ul> | Decodes the MP3 and FLAC files respectively. |
| [pulsesink](https://docs.qualcomm.com/doc/80-70022-50/topic/pulsesink.html) | Plays the decoded audio. |

## Related information

[Audio use cases](https://docs.qualcomm.com/doc/80-70022-50/topic/audio-use-cases.html)

**Parent Topic:** [Run sample applications for video and audio](https://docs.qualcomm.com/doc/80-70022-50/topic/audio-sample-applications.html)

Last Published: Feb 20, 2026

[Previous Topic
Audio and video encode](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-audio-video-encode.md) [Next Topic
Audio recording](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/gst-audio-encode-example-without-flac.md)