# 音频播放

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

**gst-audio-decode-example** 应用程序演示了 WAV、MP3 和 FLAC 格式的音频文件的播放。对每种音频格式应用单独的 pipeline 可确保高效处理和兼容性。

该示例应用程序提供了一个可以扩展和调整的基本模板。

下图展示了一个 pipeline：读取和解析音频文件，然后解码和播放音频。有关 pipeline 中使用的插件的信息，请参见 [Pipeline 流](https://docs.qualcomm.com/doc/80-70022-50SC/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" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export gst_audio_decode_example.svg Layer_2 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.52068in" height="3.86109in" viewbox="0 0 613.489 277.999" xml:space="preserve" color-interpolation-filters="sRGB" class="st15"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st3 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st5 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st6 { fill: #000000; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st7 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #ffffff; font-family: SimHei; font-size: 1.00001em }
.svg-1 .st9 { font-size: 1em }
.svg-1 .st10 { font-family: SimHei; font-size: 1em }
.svg-1 .st11 { fill: none }
.svg-1 .st12 { fill: none; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st13 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st14 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st15 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Layer_2</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape2-1" v:mid="2" v:groupcontext="shape" transform="translate(0.37488,-0.375)">		<title>Sheet.2</title>		<path d="M0 272.37 A5.62513 5.62513 -180 0 0 5.62 278 L607.11 278 A5.62513 5.62513 -180 0 0 612.74 272.37 L612.74 6.38					 A5.62513 5.62513 -180 0 0 607.11 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.38 L0 272.37 Z" class="st1"></path>	</g>	<g id="shape3-3" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M607.49 0.75 C610.38 0.75 612.74 3.11 612.74 6 L612.74 272 C612.74 274.89 610.38 277.25 607.49 277.25 L6 277.25					 C3.11 277.25 0.75 274.89 0.75 272 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L607.49 0.75 ZM607.49 0 L6 0 C2.69					 0 0 2.69 0 6 L0 272 C0 275.31 2.69 278 6 278 L607.49 278 C610.8 278 613.49 275.31 613.49 272 L613.49 6 C613.49					 2.69 610.8 0 607.49 0 Z" class="st2"></path>	</g>	<g id="group6-5" transform="translate(404.791,-223.191)" v:mid="6" v:groupcontext="group">		<title>Sheet.6</title>		<g id="shape7-6" v:mid="7" v:groupcontext="shape" transform="translate(0,-2.9918)">			<title>Sheet.7</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape8-9" v:mid="8" v:groupcontext="shape" transform="translate(17.3189,0)">			<title>Sheet.8</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape9-11" v:mid="9" v:groupcontext="shape" transform="translate(312.437,-250.481)">		<title>Sheet.9</title>		<desc>mpg123audiodec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="47.3543" cy="270.799" width="94.71" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="94.7087" height="14.4" class="st5"></rect>		<text x="0.72" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpg123audiodec</text>		</g>	<g id="shape10-14" v:mid="10" v:groupcontext="shape" transform="translate(314.791,-203.683)">		<title>Sheet.10</title>		<desc>解码</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>解码</text>		</g>	<g id="shape12-17" v:mid="12" v:groupcontext="shape" transform="translate(427.774,-250.481)">		<title>Sheet.12</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.4947" cy="270.799" width="88.99" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="88.9893" height="14.4" class="st5"></rect>		<text x="19.19" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="shape13-20" v:mid="13" v:groupcontext="shape" transform="translate(427.774,-203.683)">		<title>Sheet.13</title>		<desc>播放</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>播放</text>		</g>	<g id="shape15-23" v:mid="15" v:groupcontext="shape" transform="translate(427.774,-165.203)">		<title>Sheet.15</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.4947" cy="270.799" width="88.99" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="88.9893" height="14.4" class="st5"></rect>		<text x="19.19" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="shape16-26" v:mid="16" v:groupcontext="shape" transform="translate(427.774,-118.405)">		<title>Sheet.16</title>		<desc>播放</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>播放</text>		</g>	<g id="group18-29" transform="translate(404.791,-52.6353)" v:mid="18" v:groupcontext="group">		<title>Sheet.18</title>		<g id="shape19-30" v:mid="19" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.19</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape20-33" v:mid="20" v:groupcontext="shape" transform="translate(17.3189,-5.68434E-14)">			<title>Sheet.20</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape21-35" v:mid="21" v:groupcontext="shape" transform="translate(314.791,-79.9253)">		<title>Sheet.21</title>		<desc>flacdec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="270.799" width="90" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="90" height="14.4" class="st5"></rect>		<text x="25.35" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flacdec</text>		</g>	<g id="shape22-38" v:mid="22" v:groupcontext="shape" transform="translate(314.791,-33.1271)">		<title>Sheet.22</title>		<desc>解码</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>解码</text>		</g>	<g id="group24-41" transform="translate(292.291,-223.191)" v:mid="24" v:groupcontext="group">		<title>Sheet.24</title>		<g id="shape25-42" v:mid="25" v:groupcontext="shape" transform="translate(0,-2.9918)">			<title>Sheet.25</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape26-45" v:mid="26" v:groupcontext="shape" transform="translate(17.3189,0)">			<title>Sheet.26</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape27-47" v:mid="27" v:groupcontext="shape" transform="translate(202.291,-250.481)">		<title>Sheet.27</title>		<desc>mpegaudioparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.9874" cy="270.799" width="89.98" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="89.9748" height="14.4" class="st5"></rect>		<text x="0.05" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpegaudioparse</text>		</g>	<g id="shape28-50" v:mid="28" v:groupcontext="shape" transform="translate(202.291,-203.683)">		<title>Sheet.28</title>		<desc>解析</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>解析</text>		</g>	<g id="group30-53" transform="translate(292.291,-137.913)" v:mid="30" v:groupcontext="group">		<title>Sheet.30</title>		<g id="shape31-54" v:mid="31" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.31</title>			<path d="M0 278 L131.18 278" class="st3"></path>		</g>		<g id="shape32-57" v:mid="32" v:groupcontext="shape" transform="translate(130.302,-5.68434E-14)">			<title>Sheet.32</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape33-59" v:mid="33" v:groupcontext="shape" transform="translate(202.291,-165.203)">		<title>Sheet.33</title>		<desc>wavparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.9874" cy="270.799" width="89.98" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="89.9748" height="14.4" class="st5"></rect>		<text x="19.38" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>wavparse</text>		</g>	<g id="shape34-62" v:mid="34" v:groupcontext="shape" transform="translate(202.291,-118.405)">		<title>Sheet.34</title>		<desc>解析</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>解析</text>		</g>	<g id="group36-65" transform="translate(292.291,-52.6353)" v:mid="36" v:groupcontext="group">		<title>Sheet.36</title>		<g id="shape37-66" v:mid="37" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.37</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape38-69" v:mid="38" v:groupcontext="shape" transform="translate(17.3189,-5.68434E-14)">			<title>Sheet.38</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape39-71" v:mid="39" v:groupcontext="shape" transform="translate(202.291,-79.9253)">		<title>Sheet.39</title>		<desc>flacparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.9874" cy="270.799" width="89.98" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="89.9748" height="14.4" class="st5"></rect>		<text x="20.11" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flacparse</text>		</g>	<g id="shape40-74" v:mid="40" v:groupcontext="shape" transform="translate(202.291,-33.1271)">		<title>Sheet.40</title>		<desc>解析</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>解析</text>		</g>	<g id="group42-77" transform="translate(179.791,-223.191)" v:mid="42" v:groupcontext="group">		<title>Sheet.42</title>		<g id="shape43-78" v:mid="43" v:groupcontext="shape" transform="translate(0,-2.9918)">			<title>Sheet.43</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape44-81" v:mid="44" v:groupcontext="shape" transform="translate(17.3189,0)">			<title>Sheet.44</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape45-83" v:mid="45" v:groupcontext="shape" transform="translate(89.7913,-250.481)">		<title>Sheet.45</title>		<desc>mp3 filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="270.799" width="90" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="90" height="14.4" class="st5"></rect>		<text x="15.08" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mp3 filesrc</text>		</g>	<g id="shape46-86" v:mid="46" v:groupcontext="shape" transform="translate(89.7913,-203.683)">		<title>Sheet.46</title>		<desc>数据采集</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="21" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据采集</text>		</g>	<g id="group48-89" transform="translate(179.791,-137.913)" v:mid="48" v:groupcontext="group">		<title>Sheet.48</title>		<g id="shape49-90" v:mid="49" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.49</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape50-93" v:mid="50" v:groupcontext="shape" transform="translate(17.3189,-5.68434E-14)">			<title>Sheet.50</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape51-95" v:mid="51" v:groupcontext="shape" transform="translate(89.7913,-165.203)">		<title>Sheet.51</title>		<desc>wav filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="270.799" width="90" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="90" height="14.4" class="st5"></rect>		<text x="16.4" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>wav filesrc</text>		</g>	<g id="shape52-98" v:mid="52" v:groupcontext="shape" transform="translate(89.7913,-118.405)">		<title>Sheet.52</title>		<desc>数据采集</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="21" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据采集</text>		</g>	<g id="group54-101" transform="translate(179.791,-52.6353)" v:mid="54" v:groupcontext="group">		<title>Sheet.54</title>		<g id="shape55-102" v:mid="55" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.55</title>			<path d="M0 278 L18.19 278" class="st3"></path>		</g>		<g id="shape56-105" v:mid="56" v:groupcontext="shape" transform="translate(17.3189,-5.68434E-14)">			<title>Sheet.56</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape57-107" v:mid="57" v:groupcontext="shape" transform="translate(89.7913,-79.9253)">		<title>Sheet.57</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="270.799" width="90" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="90" height="14.4" class="st5"></rect>		<text x="28.56" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="shape58-110" v:mid="58" v:groupcontext="shape" transform="translate(89.7913,-33.1271)">		<title>Sheet.58</title>		<desc>数据采集</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="21" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>数据采集</text>		</g>	<g id="shape60-113" v:mid="60" v:groupcontext="shape" transform="translate(427.774,-79.9253)">		<title>Sheet.60</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.4947" cy="270.799" width="88.99" height="14.4"></v:textrect>		<rect x="0" y="263.599" width="88.9893" height="14.4" class="st5"></rect>		<text x="19.19" y="274.4" class="st6" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="shape61-116" v:mid="61" v:groupcontext="shape" transform="translate(427.774,-33.1271)">		<title>Sheet.61</title>		<desc>播放</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="255.499" width="90.01" height="45"></v:textrect>		<path d="M0 275 A3.00007 3.00007 -180 0 0 3 278 L87 278 A3.00007 3.00007 -180 0 0 90 275 L90 236 A3.00007 3.00007 -180					 0 0 87 233 L3 233 A3.00007 3.00007 -180 0 0 -0 236 L0 275 Z" class="st7"></path>		<text x="33" y="259.49" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>播放</text>		</g>	<g id="shape63-119" v:mid="63" v:groupcontext="shape" transform="translate(4.5,-104.677)">		<title>Sheet.63</title>		<desc>mp3 wav flac i/p 文件</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="20.25" cy="241.771" width="40.5" height="72.455"></v:textrect>		<rect x="0" y="205.544" width="40.5" height="72.455" class="st5"></rect>		<text x="16.51" y="215.78" class="st6" v:langid="1033"><v:paragraph v:horizalign="2"></v:paragraph><v:tablist></v:tablist>mp3<v:newlinechar></v:newlinechar><tspan x="19.14" dy="1.2em" class="st9">wav<v:newlinechar></v:newlinechar></tspan><tspan x="20.61" dy="1.2em" class="st9">flac<v:newlinechar></v:newlinechar></tspan><tspan x="25.91" dy="1.2em" class="st9">i/p </tspan><tspan x="16.5" dy="1.298em" class="st10">文件</tspan></text>		</g>	<g id="group64-126" transform="translate(52.4405,-137.913)" v:mid="64" v:groupcontext="group">		<title>Sheet.64</title>		<g id="shape65-127" v:mid="65" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.65</title>			<path d="M0 278 L33.05 278" class="st3"></path>		</g>		<g id="shape66-130" v:mid="66" v:groupcontext="shape" transform="translate(32.1697,-5.68434E-14)">			<title>Sheet.66</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape67-132" v:mid="67" v:groupcontext="shape" transform="translate(62.1412,-53.9101)">		<title>Sheet.67</title>		<path d="M27.65 105.73 L0 105.73 L0 278 L27.65 278 L27.65 105.73 Z" class="st11"></path>		<path d="M27.65 105.73 L0 105.73 L0 278 L27.65 278" class="st3"></path>	</g>	<g id="group68-135" transform="translate(518.567,-137.913)" v:mid="68" v:groupcontext="group">		<title>Sheet.68</title>		<g id="shape69-136" v:mid="69" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.69</title>			<path d="M0 278 L48.42 278" class="st3"></path>		</g>		<g id="shape70-139" v:mid="70" v:groupcontext="shape" transform="translate(47.5419,-5.68434E-14)">			<title>Sheet.70</title>			<path d="M0 278 L5.18 275.01 L0 272.01 L0 278 Z" class="st4"></path>		</g>	</g>	<g id="shape71-141" v:mid="71" v:groupcontext="shape" transform="translate(517.839,-55.6271)">		<title>Sheet.71</title>		<path d="M0 278 L17.09 278 L17.09 107.44 L0 107.44 L0 278 Z" class="st11"></path>		<path d="M0 278 L17.09 278 L17.09 107.44 L0 107.44" class="st3"></path>	</g>	<g id="group72-144" transform="translate(574.333,-131.218)" v:mid="72" v:groupcontext="group">		<title>Sheet.72</title>		<g id="shape73-145" v:mid="73" v:groupcontext="shape">			<title>Sheet.73</title>			<path d="M10.8 259.55 C10.8 259.09 10.42 258.71 9.95 258.71 C9.73 258.71 9.51 258.8 9.36 258.96 L5.3 263.02 C4.98						 263.33 4.55 263.51 4.1 263.51 L1.2 263.51 C0.54 263.51 0 264.05 0 264.71 L0 271.91 C0 272.57 0.54 273.11						 1.2 273.11 L4.1 273.11 C4.55 273.11 4.98 273.29 5.3 273.61 L9.36 277.67 C9.69 278 10.22 278 10.55 277.67						 C10.71 277.51 10.8 277.29 10.8 277.07 L10.8 259.55 Z" class="st12"></path>		</g>		<g id="shape74-147" v:mid="74" v:groupcontext="shape" transform="translate(16.7999,-6.08761)">			<title>Sheet.74</title>			<path d="M0 270.8 C1.6 272.93 1.6 275.87 0 278 L0 270.8 Z" class="st11"></path>			<path d="M0 270.8 C1.6 272.93 1.6 275.87 0 278" class="st13"></path>		</g>		<g id="shape75-150" v:mid="75" v:groupcontext="shape" transform="translate(20.8367,-2.05083)">			<title>Sheet.75</title>			<path d="M0 278 C4.22 273.78 4.22 266.94 0 262.73 C0 262.73 0 262.72 0 262.72 L0 278 Z" class="st11"></path>			<path d="M0 278 C4.22 273.78 4.22 266.94 0 262.73 C0 262.73 0 262.72 0 262.72" class="st13"></path>		</g>	</g>	<g id="group98-153" transform="translate(563.2,-13.4339)" v:mid="98" v:groupcontext="group">		<title>Sheet.98</title>		<g id="shape77-154" v:mid="77" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.77</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="271.699" width="21" height="12.6"></v:textrect>			<rect x="0" y="265.399" width="21" height="12.6" class="st5"></rect>			<text x="-0" y="275.19" class="st14" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape78-157" v:mid="78" v:groupcontext="shape" transform="translate(3.09752E-14,-0.218622)">			<title>Sheet.78</title>			<path d="M0 276.5 A1.50003 1.50003 -180 0 0 1.5 278 L10.5 278 A1.50003 1.50003 -180 0 0 12 276.5 L12 267.5 A1.50003						 1.50003 -180 0 0 10.5 266 L1.5 266 A1.50003 1.50003 -180 0 0 -0 267.5 L0 276.5 Z" class="st7"></path>		</g>	</g></g>
</svg>

## 运行应用程序

1. 确保您已完成[前提条件](https://docs.qualcomm.com/doc/80-70022-50SC/topic/mm_sample_apps_prerequisites.html)。
2. 在目标设备上导入 `<filename>.mp3`、`<filename>.WAV` 或 `<filename>.FLAC` 中的至少一个音频文件。
3. 在目标设备的终端中，使用以下命令运行不同音频格式的应用程序：

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

下表提供了命令行参数的说明：    | 命令行参数 | 说明 |
    | --- | --- |
    | `-i` | 指定要解码的输入音频文件的绝对路径 |
    | `--audio_format` | 指定音频文件的格式：<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> |

    例如，使用以下命令运行 MP3、WAV 或 FLAC 音频格式的应用程序：

    - 解码 MP3：

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

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

            gst-audio-decode-example -i /etc/media/<filename>.flac --audio_format=3Copy to clipboard
4. 要停止用例，请使用 CTRL +
                    C。
5. 在目标设备的终端中，在 SSH shell 中运行以下命令以显示可用的帮助选项：

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

## 预期输出

根据格式（MP3、WAV、FLAC）播放解码的音频文件。

## Pipeline 流

下表列出了用于运行音频解码 pipeline 的插件：| 插件 | 说明 |
| --- | --- |
| filesrc | 读取音频文件。 |
| <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> | 分别解析 MPEG、WAV 和 FLAC 音频文件。 |
| <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> | 分别解码 MP3 和 FLAC 文件。 |
| [pulsesink](https://docs.qualcomm.com/doc/80-70022-50SC/topic/pulsesink.html) | 播放解码的音频。 |

## 相关信息

[音频用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/audio-use-cases.html)

**Parent Topic:** [运行视频和音频的示例应用程序](https://docs.qualcomm.com/doc/80-70022-50SC/topic/audio-sample-applications.html)

Last Published: Nov 05, 2025

[Previous Topic
音频和视频编码](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/gst-audio-video-encode.md) [Next Topic
音频录制](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/gst-audio-encode-example-without-flac.md)