# 音频用例

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

音频 GStreamer 用例展示了从文件源采集音频并通过扬声器播放音频流的过程。

在运行用例之前，请确保完成 [GStreamer 命令行用例](https://docs.qualcomm.com/doc/80-70022-50SC/topic/gstreamer-application-use-cases.html)中提到的先决条件。

## （仅）音频采集

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

用例展示了如何采集 PCM 音频流并将其存储在文件中。

- 在目标设备的 SSH shell 中运行所有命令。
- 要停止用例，请使用 CTRL + C。

### 单个 PCM 采集

    gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! wavenc ! filesink location=/opt/<Audio_PCM>.wavCopy to clipboard

Figure : 使用 PCM 编码进行音频捕获的 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 pipeline_audio_capture_pcm_encode.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="7.86458in" height="1.5236in" viewbox="0 0 566.25 109.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><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: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-1 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-1 .st10 { 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.375,-0.374989)">		<title>Sheet.2</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="282.75" cy="55.2247" width="565.5" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L559.87 109.7 A5.62513 5.62513 -180 0 0 565.5 104.07 L565.5 6.37					 A5.62513 5.62513 -180 0 0 559.87 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 104.07 Z" class="st1"></path>		<text x="259.95" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape3-4" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M560.25 0.75 C563.14 0.75 565.5 3.11 565.5 6 L565.5 103.7 C565.5 106.59 563.14 108.95 560.25 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L560.25 0.75 ZM560.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L560.25 109.7 C563.56 109.7 566.25 107.01 566.25 103.7					 L566.25 6 C566.25 2.69 563.56 0 560.25 0 Z" class="st3"></path>	</g>	<g id="shape10-6" v:mid="10" v:groupcontext="shape" transform="translate(15,-34.0416)">		<title>Sheet.10</title>		<desc>pulsesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="37.33" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesrc</text>		</g>	<g id="shape13-9" v:mid="13" v:groupcontext="shape" transform="translate(135,-52.7916)">		<title>Sheet.13</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape14-12" v:mid="14" v:groupcontext="shape" transform="translate(149.217,-50.1738)">		<title>Sheet.14</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape16-14" v:mid="16" v:groupcontext="shape" transform="translate(153.75,-34.0416)">		<title>Sheet.16</title>		<desc>audioconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="25.22" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioconvert</text>		</g>	<g id="shape19-17" v:mid="19" v:groupcontext="shape" transform="translate(273.75,-52.7916)">		<title>Sheet.19</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape20-20" v:mid="20" v:groupcontext="shape" transform="translate(287.966,-50.1738)">		<title>Sheet.20</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(292.5,-34.0416)">		<title>Sheet.22</title>		<desc>wavenc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="39.69" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>wavenc</text>		</g>	<g id="shape25-25" v:mid="25" v:groupcontext="shape" transform="translate(412.5,-52.7916)">		<title>Sheet.25</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape26-28" v:mid="26" v:groupcontext="shape" transform="translate(426.716,-50.1738)">		<title>Sheet.26</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape28-30" v:mid="28" v:groupcontext="shape" transform="translate(431.25,-34.0416)">		<title>Sheet.28</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="40.92" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="group32-33" transform="translate(515.062,-11.5293)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape5-34" v:mid="5" v:groupcontext="shape" transform="translate(15.1883,1.42109E-14)">			<title>Sheet.5</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.4" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="97.0995" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.89" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape6-37" v:mid="6" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218632)">			<title>Sheet.6</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

### 单个 FLAC 采集

    gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! flacenc ! filesink location=/opt/<flac_file>.flacCopy to clipboard

Figure : 使用 FLAC 编码进行音频捕获的 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 pipeline_audio_capture_flac_encode.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="7.86458in" height="1.5236in" viewbox="0 0 566.25 109.699" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-2 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-2 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-2 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-2 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-2 .st10 { 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>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="shape2-1" v:mid="2" v:groupcontext="shape" transform="translate(0.375,-0.374989)">		<title>Sheet.2</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="282.75" cy="55.2247" width="565.5" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L559.87 109.7 A5.62513 5.62513 -180 0 0 565.5 104.07 L565.5 6.37					 A5.62513 5.62513 -180 0 0 559.87 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 104.07 Z" class="st1"></path>		<text x="259.95" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape3-4" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M560.25 0.75 C563.14 0.75 565.5 3.11 565.5 6 L565.5 103.7 C565.5 106.59 563.14 108.95 560.25 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L560.25 0.75 ZM560.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L560.25 109.7 C563.56 109.7 566.25 107.01 566.25 103.7					 L566.25 6 C566.25 2.69 563.56 0 560.25 0 Z" class="st3"></path>	</g>	<g id="shape10-6" v:mid="10" v:groupcontext="shape" transform="translate(15,-34.0416)">		<title>Sheet.10</title>		<desc>pulsesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="37.33" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesrc</text>		</g>	<g id="shape13-9" v:mid="13" v:groupcontext="shape" transform="translate(135,-52.7916)">		<title>Sheet.13</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape14-12" v:mid="14" v:groupcontext="shape" transform="translate(149.217,-50.1738)">		<title>Sheet.14</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape16-14" v:mid="16" v:groupcontext="shape" transform="translate(153.75,-34.0416)">		<title>Sheet.16</title>		<desc>audioconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="25.22" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioconvert</text>		</g>	<g id="shape19-17" v:mid="19" v:groupcontext="shape" transform="translate(273.75,-52.7916)">		<title>Sheet.19</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape20-20" v:mid="20" v:groupcontext="shape" transform="translate(287.966,-50.1738)">		<title>Sheet.20</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(292.5,-34.0416)">		<title>Sheet.22</title>		<desc>flacenc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="40.43" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flacenc</text>		</g>	<g id="shape25-25" v:mid="25" v:groupcontext="shape" transform="translate(412.5,-52.7916)">		<title>Sheet.25</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape26-28" v:mid="26" v:groupcontext="shape" transform="translate(426.716,-50.1738)">		<title>Sheet.26</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape28-30" v:mid="28" v:groupcontext="shape" transform="translate(431.25,-34.0416)">		<title>Sheet.28</title>		<desc>filesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="40.92" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesink</text>		</g>	<g id="group36-33" transform="translate(515.062,-11.5293)" v:mid="36" v:groupcontext="group">		<title>Sheet.36</title>		<g id="shape5-34" v:mid="5" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.5</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.399" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="97.0995" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.55" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape6-37" v:mid="6" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218624)">			<title>Sheet.6</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

## （仅）音频播放

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

此 pipeline 显示了在扬声器上播放单个音频流的用例。

- 在目标设备的 SSH shell 中运行所有命令。
- 要停止用例，请使用 CTRL + C。

### 单次 PCM 播放

    gst-launch-1.0 -e filesrc location=/opt/<wav_file>.wav ! wavparse ! audioconvert ! pulsesink volume=10Copy to clipboard

此 pipeline 显示从文件源获取并在扬声器上播放的单个 WAV 流。

Figure : WAV 流播放的 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 pipeline_wav_stream_playback.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="7.86458in" height="1.5236in" viewbox="0 0 566.25 109.699" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-3 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-3 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-3 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-3 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-3 .st10 { 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.375,-0.374989)">		<title>Sheet.2</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="282.75" cy="55.2247" width="565.5" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L559.87 109.7 A5.62513 5.62513 -180 0 0 565.5 104.07 L565.5 6.37					 A5.62513 5.62513 -180 0 0 559.87 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 104.07 Z" class="st1"></path>		<text x="259.95" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape3-4" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M560.25 0.75 C563.14 0.75 565.5 3.11 565.5 6 L565.5 103.7 C565.5 106.59 563.14 108.95 560.25 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L560.25 0.75 ZM560.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L560.25 109.7 C563.56 109.7 566.25 107.01 566.25 103.7					 L566.25 6 C566.25 2.69 563.56 0 560.25 0 Z" class="st3"></path>	</g>	<g id="shape10-6" v:mid="10" v:groupcontext="shape" transform="translate(15,-34.0416)">		<title>Sheet.10</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="43.56" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="shape13-9" v:mid="13" v:groupcontext="shape" transform="translate(135,-52.7916)">		<title>Sheet.13</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape14-12" v:mid="14" v:groupcontext="shape" transform="translate(149.217,-50.1738)">		<title>Sheet.14</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape16-14" v:mid="16" v:groupcontext="shape" transform="translate(153.75,-34.0416)">		<title>Sheet.16</title>		<desc>wavparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.39" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>wavparse</text>		</g>	<g id="shape19-17" v:mid="19" v:groupcontext="shape" transform="translate(273.75,-52.7916)">		<title>Sheet.19</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape20-20" v:mid="20" v:groupcontext="shape" transform="translate(287.966,-50.1738)">		<title>Sheet.20</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(292.5,-34.0416)">		<title>Sheet.22</title>		<desc>audioconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="25.22" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioconvert</text>		</g>	<g id="shape25-25" v:mid="25" v:groupcontext="shape" transform="translate(412.5,-52.7916)">		<title>Sheet.25</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape26-28" v:mid="26" v:groupcontext="shape" transform="translate(426.716,-50.1738)">		<title>Sheet.26</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape28-30" v:mid="28" v:groupcontext="shape" transform="translate(431.25,-34.0416)">		<title>Sheet.28</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.7" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="group30-33" transform="translate(515.062,-11.5293)" v:mid="30" v:groupcontext="group">		<title>Sheet.30</title>		<g id="shape5-34" v:mid="5" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.5</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.399" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="97.0995" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.89" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape6-37" v:mid="6" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218624)">			<title>Sheet.6</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

### 单次 MP2/MP3 播放

- MP2

        gst-launch-1.0 -e filesrc location=/opt/<mp2_file>.mp2 ! mpegaudioparse ! mpg123audiodec ! pulsesink volume=10Copy to clipboard
- MP3

        gst-launch-1.0 -e filesrc location=/opt/<mp3_file>.mp3 ! mpegaudioparse ! mpg123audiodec ! pulsesink volume=10Copy to clipboard

此 pipeline 显示从文件源获取并在扬声器上播放的单个 MP2 流。

Figure : MP2/MP3 流播放 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 pipeline_mp2_mp3_stream_playback.svg pipeline_mp2_mp3_stream_playbac -->
<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="7.86458in" height="1.5236in" viewbox="0 0 566.25 109.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-4 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-4 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-4 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-4 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-4 .st10 { 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>pipeline_mp2_mp3_stream_playbac</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375046,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="282.75" cy="55.2247" width="565.5" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L559.87 109.7 A5.62513 5.62513 -180 0 0 565.5 104.07 L565.5 6.37					 A5.62513 5.62513 -180 0 0 559.87 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 104.07 Z" class="st1"></path>		<text x="259.95" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M560.25 0.75 C563.14 0.75 565.5 3.11 565.5 6 L565.5 103.7 C565.5 106.59 563.14 108.95 560.25 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L560.25 0.75 ZM560.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L560.25 109.7 C563.56 109.7 566.25 107.01 566.25 103.7					 L566.25 6 C566.25 2.69 563.56 0 560.25 0 Z" class="st3"></path>	</g>	<g id="shape12-6" v:mid="12" v:groupcontext="shape" transform="translate(15,-34.8825)">		<title>Sheet.12</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="43.56" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group14-9" transform="translate(135,-51.0147)" v:mid="14" v:groupcontext="group">		<title>Sheet.14</title>		<g id="shape15-10" v:mid="15" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.15</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape16-13" v:mid="16" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.16</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape18-15" v:mid="18" v:groupcontext="shape" transform="translate(153.75,-34.8825)">		<title>Sheet.18</title>		<desc>mpegaudioparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="15.06" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpegaudioparse</text>		</g>	<g id="group20-18" transform="translate(273.75,-51.0147)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-19" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.21</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.22</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape24-24" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-34.8825)">		<title>Sheet.24</title>		<desc>mpg123audiodec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="13.36" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpg123audiodec</text>		</g>	<g id="group26-27" transform="translate(412.5,-51.0147)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-28" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.27</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape28-31" v:mid="28" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.28</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape30-33" v:mid="30" v:groupcontext="shape" transform="translate(431.25,-34.8825)">		<title>Sheet.30</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.7" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="group32-36" transform="translate(515.062,-11.5293)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape6-37" v:mid="6" v:groupcontext="shape" transform="translate(15.1883,1.42109E-14)">			<title>Sheet.6</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.4" width="21" height="12.6"></v:textrect>			<rect x="0" y="97.0995" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.89" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-40" v:mid="7" v:groupcontext="shape" transform="translate(-9.99201E-16,-0.218643)">			<title>Sheet.7</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

### 单次 FLAC 播放

    gst-launch-1.0 -e filesrc location=/opt/<flac_file>.flac ! flacparse ! flacdec ! pulsesink volume=10Copy to clipboard

此 pipeline 显示从文件源获取并在扬声器上播放的单个 FLAC 流。

Figure : FLAC 流播放 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 pipeline_flac_stream_playback.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="7.86458in" height="1.5236in" viewbox="0 0 566.25 109.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-5 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-5 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-5 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-5 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-5 .st10 { 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.375,-0.375092)">		<title>Sheet.2</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="282.75" cy="55.2247" width="565.5" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L559.87 109.7 A5.62513 5.62513 -180 0 0 565.5 104.07 L565.5 6.37					 A5.62513 5.62513 -180 0 0 559.87 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 0 6.37 L0 104.07 Z" class="st1"></path>		<text x="259.95" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape3-4" v:mid="3" v:groupcontext="shape">		<title>Sheet.3</title>		<path d="M560.25 0.75 C563.14 0.75 565.5 3.11 565.5 6 L565.5 103.7 C565.5 106.59 563.14 108.95 560.25 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L560.25 0.75 ZM560.25 0 L6 0 C2.69					 0 0 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L560.25 109.7 C563.56 109.7 566.25 107.01 566.25 103.7					 L566.25 6 C566.25 2.69 563.56 0 560.25 0 Z" class="st3"></path>	</g>	<g id="shape10-6" v:mid="10" v:groupcontext="shape" transform="translate(15,-34.8825)">		<title>Sheet.10</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="43.56" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="shape13-9" v:mid="13" v:groupcontext="shape" transform="translate(135,-53.6325)">		<title>Sheet.13</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape14-12" v:mid="14" v:groupcontext="shape" transform="translate(149.217,-51.0147)">		<title>Sheet.14</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape16-14" v:mid="16" v:groupcontext="shape" transform="translate(153.75,-34.8825)">		<title>Sheet.16</title>		<desc>flacparse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="35.12" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flacparse</text>		</g>	<g id="shape19-17" v:mid="19" v:groupcontext="shape" transform="translate(273.75,-53.6325)">		<title>Sheet.19</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape20-20" v:mid="20" v:groupcontext="shape" transform="translate(287.966,-51.0147)">		<title>Sheet.20</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(292.5,-34.8825)">		<title>Sheet.22</title>		<desc>flacdec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="40.35" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>flacdec</text>		</g>	<g id="shape25-25" v:mid="25" v:groupcontext="shape" transform="translate(412.5,-53.6325)">		<title>Sheet.25</title>		<path d="M0 109.7 L14.98 109.7" class="st6"></path>	</g>	<g id="shape26-28" v:mid="26" v:groupcontext="shape" transform="translate(426.716,-51.0147)">		<title>Sheet.26</title>		<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>	</g>	<g id="shape28-30" v:mid="28" v:groupcontext="shape" transform="translate(431.25,-34.8825)">		<title>Sheet.28</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9495" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.7" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="group30-33" transform="translate(515.062,-11.5293)" v:mid="30" v:groupcontext="group">		<title>Sheet.30</title>		<g id="shape5-34" v:mid="5" v:groupcontext="shape" transform="translate(15.1883,1.42109E-14)">			<title>Sheet.5</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.4" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="97.0995" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.89" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape6-37" v:mid="6" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218643)">			<title>Sheet.6</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

### 单次 OGG 回放

    gst-launch-1.0 -e filesrc location=/opt/<ogg_file>.ogg ! oggdemux ! vorbisdec ! audioconvert ! pulsesink volume=10Copy to clipboard

此 pipeline 显示从文件源获取并在扬声器上播放的单个 OGG 流。

Figure : OGG 流播放 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 pipeline_ogg_stream_playback.svg pipeline_ogg_stream_playback -->
<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="9.79167in" height="1.52361in" viewbox="0 0 705 109.7" xml:space="preserve" color-interpolation-filters="sRGB" class="st10"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-6 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em; font-weight: bold }
.svg-6 .st3 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st4 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-6 .st6 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st7 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st8 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-6 .st9 { fill: #000000; font-family: SimHei; font-size: 0.874992em }
.svg-6 .st10 { 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>pipeline_ogg_stream_playback</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape3-1" v:mid="3" v:groupcontext="shape" transform="translate(0.375,-0.375092)">		<title>Sheet.3</title>		<desc>GST BIN</desc>		<v:textblock v:margins="rect(7.2,0,0,0)" v:verticalalign="0"></v:textblock>		<v:textrect cx="352.125" cy="55.2248" width="704.26" height="108.95"></v:textrect>		<path d="M0 104.07 A5.62513 5.62513 -180 0 0 5.62 109.7 L698.63 109.7 A5.62513 5.62513 -180 0 0 704.25 104.07 L704.25					 6.38 A5.62513 5.62513 -180 0 0 698.63 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.38 L0 104.07 Z" class="st1"></path>		<text x="329.33" y="18.75" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GST BIN</text>		</g>	<g id="shape4-4" v:mid="4" v:groupcontext="shape">		<title>Sheet.4</title>		<path d="M699 0.75 C701.89 0.75 704.25 3.11 704.25 6 L704.25 103.7 C704.25 106.59 701.89 108.95 699 108.95 L6 108.95					 C3.11 108.95 0.75 106.59 0.75 103.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L699 0.75 ZM699 0 L6 0 C2.69 0 0					 2.69 0 6 L0 103.7 C0 107.01 2.69 109.7 6 109.7 L699 109.7 C702.31 109.7 705 107.01 705 103.7 L705 6 C705					 2.69 702.31 0 699 0 Z" class="st3"></path>	</g>	<g id="shape12-6" v:mid="12" v:groupcontext="shape" transform="translate(15,-34.0417)">		<title>Sheet.12</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9496" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="43.56" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group14-9" transform="translate(135,-50.1739)" v:mid="14" v:groupcontext="group">		<title>Sheet.14</title>		<g id="shape15-10" v:mid="15" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.15</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape16-13" v:mid="16" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.16</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape18-15" v:mid="18" v:groupcontext="shape" transform="translate(153.75,-34.0417)">		<title>Sheet.18</title>		<desc>oggdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9496" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="31.74" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>oggdemux</text>		</g>	<g id="group20-18" transform="translate(273.75,-50.1739)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-19" v:mid="21" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.21</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape22-22" v:mid="22" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.22</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape24-24" v:mid="24" v:groupcontext="shape" transform="translate(292.5,-34.0417)">		<title>Sheet.24</title>		<desc>vorbisdec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9496" width="120.01" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.02" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>vorbisdec</text>		</g>	<g id="group26-27" transform="translate(412.5,-50.1739)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-28" v:mid="27" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.27</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape28-31" v:mid="28" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.28</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape30-33" v:mid="30" v:groupcontext="shape" transform="translate(431.25,-34.0417)">		<title>Sheet.30</title>		<desc>audioconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9496" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="25.22" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioconvert</text>		</g>	<g id="group32-36" transform="translate(551.25,-50.1739)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-37" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.61782)">			<title>Sheet.33</title>			<path d="M0 109.7 L14.98 109.7" class="st6"></path>		</g>		<g id="shape34-40" v:mid="34" v:groupcontext="shape" transform="translate(14.2165,4.26326E-14)">			<title>Sheet.34</title>			<path d="M0 109.7 L4.53 107.08 L0 104.46 L0 109.7 Z" class="st7"></path>		</g>	</g>	<g id="shape36-42" v:mid="36" v:groupcontext="shape" transform="translate(570,-34.0417)">		<title>Sheet.36</title>		<desc>pulsesink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="60" cy="90.9496" width="120" height="37.5"></v:textrect>		<path d="M0 106.7 A3.00007 3.00007 -180 0 0 3 109.7 L117 109.7 A3.00007 3.00007 -180 0 0 120 106.7 L120 75.2 A3.00007					 3.00007 -180 0 0 117 72.2 L3 72.2 A3.00007 3.00007 -180 0 0 0 75.2 L0 106.7 Z" class="st4"></path>		<text x="34.7" y="94.55" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesink</text>		</g>	<g id="group38-45" transform="translate(653.812,-11.5294)" v:mid="38" v:groupcontext="group">		<title>Sheet.38</title>		<g id="shape6-46" v:mid="6" v:groupcontext="shape" transform="translate(15.1883,1.42109E-14)">			<title>Sheet.6</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5" cy="103.4" width="21.01" height="12.6"></v:textrect>			<rect x="0" y="97.0996" width="21" height="12.6" class="st8"></rect>			<text x="0" y="106.89" class="st9" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape7-49" v:mid="7" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218622)">			<title>Sheet.7</title>			<path d="M0 108.2 A1.50003 1.50003 -180 0 0 1.5 109.7 L10.5 109.7 A1.50003 1.50003 -180 0 0 12 108.2 L12 99.2 A1.50003						 1.50003 -180 0 0 10.5 97.7 L1.5 97.7 A1.50003 1.50003 -180 0 0 0 99.2 L0 108.2 Z" class="st4"></path>		</g>	</g></g>
</svg>

### 相关信息

- [音频播放](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-encode-example-without-flac.html)

Last Published: Nov 05, 2025

[Previous Topic
视频播放用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/video-playback-use-cases.md) [Next Topic
音频-视频用例](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/audio-video-use-cases.md)