# 音频分类

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

**gst-ai-audio-classification** 应用程序对来自文件源或麦克风的输入显示其音频分类。将同时显示分类结果和视频预览。

Note: 此应用程序在 Ubuntu Server 上不受支持。

下图展示了一个 pipeline：从文件或麦克风获取输入，对其进行预处理，并在 AI 硬件上运行推理。结果将显示在屏幕上。

有关 pipeline 流中使用的插件的信息，请参见 [Pipeline 流](https://docs.qualcomm.com/doc/80-70022-50SC/topic/audio-classification.html#audio-classification__section_fdn_fmz_n2c)。

Figure : gst-ai-audio-classification 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_ai_audio_classification.svg gst_ai_audio_classification -->
<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="15.1819in" height="2.98195in" viewbox="0 0 1093.09 214.701" 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 { fill: #007884; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #ffffff; font-family: Roboto; font-size: 0.75em }
.svg-1 .st5 { fill: none; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st6 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5 }
.svg-1 .st7 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st8 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st9 { fill: #2a2aea; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st10 { font-size: 1em }
.svg-1 .st11 { fill: none }
.svg-1 .st12 { fill: none; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st13 { fill: #000000; font-family: Roboto; font-size: 0.75em }
.svg-1 .st14 { fill: #000000; font-family: SimHei; font-size: 0.75em }
.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>gst_ai_audio_classification</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="group2-1" v:mid="2" v:groupcontext="group">		<title>Sheet.2</title>		<g id="shape3-2" v:mid="3" v:groupcontext="shape" transform="translate(0.37516,-0.374863)">			<title>Sheet.3</title>			<path d="M0 209.08 A5.62513 5.62513 -180 0 0 5.62 214.7 L1086.72 214.7 A5.62513 5.62513 -180 0 0 1092.34 209.08 L1092.34						 6.38 A5.62513 5.62513 -180 0 0 1086.72 0.75 L5.62 0.75 A5.62513 5.62513 -180 0 0 -0 6.38 L0 209.08 Z" class="st1"></path>		</g>		<g id="shape4-4" v:mid="4" v:groupcontext="shape">			<title>Sheet.4</title>			<path d="M1087.09 0.75 C1089.99 0.75 1092.34 3.11 1092.34 6 L1092.34 208.7 C1092.34 211.6 1089.99 213.95 1087.09						 213.95 L6 213.95 C3.11 213.95 0.75 211.6 0.75 208.7 L0.75 6 C0.75 3.11 3.11 0.75 6 0.75 L1087.09 0.75						 ZM1087.09 0 L6 0 C2.69 0 0 2.69 0 6 L0 208.7 C0 212.01 2.69 214.7 6 214.7 L1087.09 214.7 C1090.41 214.7						 1093.09 212.01 1093.09 208.7 L1093.09 6 C1093.09 2.69 1090.41 0 1087.09 0 Z" class="st2"></path>		</g>	</g>	<g id="shape13-6" v:mid="13" v:groupcontext="shape" transform="translate(1013.86,-42)">		<title>Sheet.13</title>		<desc>Waylandsink</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="32.1156" cy="152.821" width="64.24" height="123.76"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L61.23 214.7 A3.00007 3.00007 -180 0 0 64.23 211.7 L64.23 93.94 A3.00007					 3.00007 -180 0 0 61.23 90.94 L3 90.94 A3.00007 3.00007 -180 0 0 -0 93.94 L0 211.7 Z" class="st3"></path>		<text x="6.81" y="156.42" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Waylandsink</text>		</g>	<g id="group15-9" transform="translate(1032.75,-175.142)" v:mid="15" v:groupcontext="group">		<title>Sheet.15</title>		<g id="group16-10" v:mid="16" v:groupcontext="group">			<title>Sheet.16</title>			<g id="shape17-11" v:mid="17" v:groupcontext="shape" transform="translate(-2.67786E-13,-5.292)">				<title>Sheet.17</title>				<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L23.46 214.7 A3.00007 3.00007 -180 0 0 26.46 211.7 L26.46							 199.18 A3.00007 3.00007 -180 0 0 23.46 196.18 L3 196.18 A3.00007 3.00007 -180 0 0 0 199.18 L0 211.7							 Z" class="st5"></path>			</g>			<g id="shape18-13" v:mid="18" v:groupcontext="shape" transform="translate(7.938,0)">				<title>Sheet.18</title>				<path d="M0 214.7 L10.58 214.7" class="st6"></path>			</g>		</g>		<g id="shape19-16" v:mid="19" v:groupcontext="shape" transform="translate(227.931,209.409) rotate(90)">			<title>Sheet.19</title>			<path d="M0 214.7 L5.29 214.7" class="st6"></path>		</g>	</g>	<g id="shape20-19" v:mid="20" v:groupcontext="shape" transform="translate(52.1703,-42)">		<title>Sheet.20</title>		<desc>filesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="31.605" cy="186.051" width="63.21" height="57.3"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L60.21 214.7 A3.00007 3.00007 -180 0 0 63.21 211.7 L63.21 160.4 A3.00007					 3.00007 -180 0 0 60.21 157.4 L3 157.4 A3.00007 3.00007 -180 0 0 0 160.4 L0 211.7 Z" class="st3"></path>		<text x="19.28" y="189.65" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>filesrc</text>		</g>	<g id="group21-22" transform="translate(115.38,-67.6582)" v:mid="21" v:groupcontext="group">		<title>Sheet.21</title>		<g id="shape22-23" v:mid="22" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.22</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape23-26" v:mid="23" v:groupcontext="shape" transform="translate(8.33125,-2.84217E-14)">			<title>Sheet.23</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape24-28" v:mid="24" v:groupcontext="shape" transform="translate(42.8586,-70.65)">		<title>Sheet.24</title>		<path d="M0 214.7 L9.31 214.7" class="st7"></path>	</g>	<g id="group25-31" transform="translate(198.769,-88.254)" v:mid="25" v:groupcontext="group">		<title>Sheet.25</title>		<g id="shape26-32" v:mid="26" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.26</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape27-35" v:mid="27" v:groupcontext="shape" transform="translate(8.33124,-2.84217E-14)">			<title>Sheet.27</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape28-37" v:mid="28" v:groupcontext="shape" transform="translate(212.332,-80.7458)">		<title>Sheet.28</title>		<desc>h264parse</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.9207" cy="204.201" width="89.85" height="21"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L86.84 214.7 A3.00007 3.00007 -180 0 0 89.84 211.7 L89.84 196.7 A3.00007					 3.00007 -180 0 0 86.84 193.7 L3 193.7 A3.00007 3.00007 -180 0 0 0 196.7 L0 211.7 Z" class="st3"></path>		<text x="23.66" y="207.8" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>h264parse</text>		</g>	<g id="group29-40" transform="translate(302.173,-88.254)" v:mid="29" v:groupcontext="group">		<title>Sheet.29</title>		<g id="shape30-41" v:mid="30" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.30</title>			<path d="M0 214.7 L8.32 214.7" class="st7"></path>		</g>		<g id="shape31-44" v:mid="31" v:groupcontext="shape" transform="translate(7.44584,-2.84217E-14)">			<title>Sheet.31</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="group32-46" transform="translate(405.527,-88.254)" v:mid="32" v:groupcontext="group">		<title>Sheet.32</title>		<g id="shape33-47" v:mid="33" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.33</title>			<path d="M0 214.7 L522.54 214.7" class="st7"></path>		</g>		<g id="shape34-50" v:mid="34" v:groupcontext="shape" transform="translate(521.661,-2.84217E-14)">			<title>Sheet.34</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape36-52" v:mid="36" v:groupcontext="shape" transform="translate(129.087,-42)">		<title>Sheet.36</title>		<desc>qtdemux</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="34.9125" cy="186.051" width="69.83" height="57.3"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L66.83 214.7 A3.00007 3.00007 -180 0 0 69.83 211.7 L69.83 160.4 A3.00007					 3.00007 -180 0 0 66.83 157.4 L3 157.4 A3.00007 3.00007 -180 0 0 -0 160.4 L0 211.7 Z" class="st3"></path>		<text x="17.31" y="189.65" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtdemux</text>		</g>	<g id="shape37-55" v:mid="37" v:groupcontext="shape" transform="translate(932.369,-42)">		<title>Sheet.37</title>		<desc>qtivcomposer</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="34.1538" cy="186.051" width="68.31" height="57.3"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L65.31 214.7 A3.00007 3.00007 -180 0 0 68.31 211.7 L68.31 160.4 A3.00007					 3.00007 -180 0 0 65.31 157.4 L3 157.4 A3.00007 3.00007 -180 0 0 -0 160.4 L0 211.7 Z" class="st9"></path>		<text x="6.67" y="189.65" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtivcomposer</text>		</g>	<g id="shape40-58" v:mid="40" v:groupcontext="shape" transform="translate(315.686,-80.7458)">		<title>Sheet.40</title>		<desc>V4l2h264dec</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="44.9207" cy="204.201" width="89.85" height="21"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L86.84 214.7 A3.00007 3.00007 -180 0 0 89.84 211.7 L89.84 196.7 A3.00007					 3.00007 -180 0 0 86.84 193.7 L3 193.7 A3.00007 3.00007 -180 0 0 0 196.7 L0 211.7 Z" class="st3"></path>		<text x="18.58" y="207.8" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>V4l2h264dec</text>		</g>	<g id="group42-61" transform="translate(198.769,-55.5078)" v:mid="42" v:groupcontext="group">		<title>Sheet.42</title>		<g id="shape43-62" v:mid="43" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.43</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape44-65" v:mid="44" v:groupcontext="shape" transform="translate(8.33124,-2.84217E-14)">			<title>Sheet.44</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="group45-67" transform="translate(301.288,-55.5082)" v:mid="45" v:groupcontext="group">		<title>Sheet.45</title>		<g id="shape46-68" v:mid="46" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.46</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape47-71" v:mid="47" v:groupcontext="shape" transform="translate(8.33124,2.84217E-14)">			<title>Sheet.47</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape48-73" v:mid="48" v:groupcontext="shape" transform="translate(212.332,-43.4996)">		<title>Sheet.48</title>		<desc>mpg123audioparse/flacparse</desc>		<v:textblock v:margins="rect(3.6,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="199.701" width="90" height="30"></v:textrect>		<path d="M-0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L87 214.7 A3.00007 3.00007 -180 0 0 90 211.7 L90 187.7 A3.00007					 3.00007 -180 0 0 87 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st3"></path>		<text x="4.25" y="197.75" class="st4" v:langid="1033"><v:paragraph v:spline="-1" v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpg123audioparse/<tspan x="26.34" dy="1.25em" class="st10">flacparse</tspan></text>		</g>	<g id="group50-77" transform="translate(405.527,-55.5082)" v:mid="50" v:groupcontext="group">		<title>Sheet.50</title>		<g id="shape51-78" v:mid="51" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.51</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape52-81" v:mid="52" v:groupcontext="shape" transform="translate(8.33124,2.84217E-14)">			<title>Sheet.52</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape53-83" v:mid="53" v:groupcontext="shape" transform="translate(315.686,-43.5)">		<title>Sheet.53</title>		<desc>mpg123audiodec/flacdec</desc>		<v:textblock v:margins="rect(3.6,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="199.701" width="90" height="30"></v:textrect>		<path d="M-0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L87 214.7 A3.00007 3.00007 -180 0 0 90 211.7 L90 187.7 A3.00007					 3.00007 -180 0 0 87 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st3"></path>		<text x="8.17" y="197.75" class="st4" v:langid="1033"><v:paragraph v:spline="-1" v:horizalign="1"></v:paragraph><v:tablist></v:tablist>mpg123audiodec/<tspan x="30.27" dy="1.25em" class="st10">flacdec</tspan></text>		</g>	<g id="group55-87" transform="translate(494.783,-55.5082)" v:mid="55" v:groupcontext="group">		<title>Sheet.55</title>		<g id="shape56-88" v:mid="56" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.56</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape57-91" v:mid="57" v:groupcontext="shape" transform="translate(8.33123,2.84217E-14)">			<title>Sheet.57</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape58-93" v:mid="58" v:groupcontext="shape" transform="translate(419.783,-43.5)">		<title>Sheet.58</title>		<desc>audioconvert</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.5" cy="199.701" width="75" height="30"></v:textrect>		<path d="M-0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L72 214.7 A3.00007 3.00007 -180 0 0 75 211.7 L75 187.7 A3.00007					 3.00007 -180 0 0 72 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st3"></path>		<text x="11.41" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioconvert</text>		</g>	<g id="group60-96" transform="translate(583.483,-55.5082)" v:mid="60" v:groupcontext="group">		<title>Sheet.60</title>		<g id="shape61-97" v:mid="61" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.61</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape62-100" v:mid="62" v:groupcontext="shape" transform="translate(8.33125,2.84217E-14)">			<title>Sheet.62</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape63-102" v:mid="63" v:groupcontext="shape" transform="translate(508.483,-43.5)">		<title>Sheet.63</title>		<desc>audioresample</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.5" cy="199.701" width="75" height="30"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L72 214.7 A3.00007 3.00007 -180 0 0 75 211.7 L75 187.7 A3.00007 3.00007					 -180 0 0 72 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st3"></path>		<text x="7.76" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audioresample</text>		</g>	<g id="group65-105" transform="translate(671.996,-55.5082)" v:mid="65" v:groupcontext="group">		<title>Sheet.65</title>		<g id="shape66-106" v:mid="66" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.66</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape67-109" v:mid="67" v:groupcontext="shape" transform="translate(8.33123,2.84217E-14)">			<title>Sheet.67</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape68-111" v:mid="68" v:groupcontext="shape" transform="translate(596.996,-43.5)">		<title>Sheet.68</title>		<desc>audiobuffersplit</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.5" cy="199.701" width="75" height="30"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L72 214.7 A3.00007 3.00007 -180 0 0 75 211.7 L75 187.7 A3.00007 3.00007					 -180 0 0 72 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st3"></path>		<text x="5.84" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audiobuffersplit</text>		</g>	<g id="group70-114" transform="translate(760.508,-55.5082)" v:mid="70" v:groupcontext="group">		<title>Sheet.70</title>		<g id="shape71-115" v:mid="71" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.71</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape72-118" v:mid="72" v:groupcontext="shape" transform="translate(8.33125,2.84217E-14)">			<title>Sheet.72</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape73-120" v:mid="73" v:groupcontext="shape" transform="translate(685.508,-43.5)">		<title>Sheet.73</title>		<desc>qtimlaconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="37.5" cy="199.701" width="75" height="30"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L72 214.7 A3.00007 3.00007 -180 0 0 75 211.7 L75 187.7 A3.00007 3.00007					 -180 0 0 72 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st9"></path>		<text x="6.03" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlaconverter</text>		</g>	<g id="group75-123" transform="translate(819.021,-55.5082)" v:mid="75" v:groupcontext="group">		<title>Sheet.75</title>		<g id="shape76-124" v:mid="76" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.76</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape77-127" v:mid="77" v:groupcontext="shape" transform="translate(8.33125,2.84217E-14)">			<title>Sheet.77</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="group78-129" transform="translate(922.533,-55.5082)" v:mid="78" v:groupcontext="group">		<title>Sheet.78</title>		<g id="shape79-130" v:mid="79" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.79</title>			<path d="M0 214.7 L5.53 214.7" class="st7"></path>		</g>		<g id="shape80-133" v:mid="80" v:groupcontext="shape" transform="translate(4.65514,2.84217E-14)">			<title>Sheet.80</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape81-135" v:mid="81" v:groupcontext="shape" transform="translate(774.021,-43.5)">		<title>Sheet.81</title>		<desc>qtimflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="22.5" cy="199.701" width="45" height="30"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L42 214.7 A3.00007 3.00007 -180 0 0 45 211.7 L45 187.7 A3.00007 3.00007					 -180 0 0 42 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st9"></path>		<text x="5.84" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimflite</text>		</g>	<g id="group83-138" transform="translate(15.7397,-128.905)" v:mid="83" v:groupcontext="group">		<title>Sheet.83</title>		<g id="shape84-139" v:mid="84" v:groupcontext="shape">			<title>Sheet.84</title>			<path d="M18.19 181.63 L3.31 181.63 C1.48 181.63 0 183.11 0 184.93 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L23.15						 214.7 C24.98 214.7 26.46 213.22 26.46 211.39 L26.46 189.89 L18.19 181.63 Z" class="st5"></path>		</g>		<g id="shape85-141" v:mid="85" v:groupcontext="shape" transform="translate(16.5375,-23.1525)">			<title>Sheet.85</title>			<path d="M0 204.78 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L9.92 214.7 L0 204.78 Z" class="st11"></path>			<path d="M0 204.78 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L9.92 214.7" class="st6"></path>		</g>		<g id="shape86-144" v:mid="86" v:groupcontext="shape" transform="translate(9.9225,-8.26875)">			<title>Sheet.86</title>			<path d="M0 204.78 L8.27 209.74 L0 214.7 L0 204.78 Z" class="st5"></path>		</g>	</g>	<g id="group87-146" transform="translate(15.7397,-54.1125)" v:mid="87" v:groupcontext="group">		<title>Sheet.87</title>		<g id="shape88-147" v:mid="88" v:groupcontext="shape">			<title>Sheet.88</title>			<path d="M18.19 181.63 L3.31 181.63 C1.48 181.63 0 183.11 0 184.93 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L23.15						 214.7 C24.98 214.7 26.46 213.22 26.46 211.39 L26.46 189.89 L18.19 181.63 Z" class="st5"></path>		</g>		<g id="shape89-149" v:mid="89" v:groupcontext="shape" transform="translate(16.5375,-23.1525)">			<title>Sheet.89</title>			<path d="M0 204.78 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L9.92 214.7 L0 204.78 Z" class="st11"></path>			<path d="M0 204.78 L0 211.39 C0 213.22 1.48 214.7 3.31 214.7 L9.92 214.7" class="st6"></path>		</g>		<g id="shape90-152" v:mid="90" v:groupcontext="shape" transform="translate(9.9225,-8.26875)">			<title>Sheet.90</title>			<path d="M0 204.78 L8.27 209.74 L0 214.7 L0 204.78 Z" class="st5"></path>		</g>	</g>	<g id="shape91-154" v:mid="91" v:groupcontext="shape" transform="translate(52.1703,-123.393)">		<title>Sheet.91</title>		<desc>pulsesrc</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="31.605" cy="192.651" width="63.21" height="44.1"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L60.21 214.7 A3.00007 3.00007 -180 0 0 63.21 211.7 L63.21 173.6 A3.00007					 3.00007 -180 0 0 60.21 170.6 L3 170.6 A3.00007 3.00007 -180 0 0 -0 173.6 L0 211.7 Z" class="st3"></path>		<text x="14.6" y="196.25" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>pulsesrc</text>		</g>	<g id="group92-157" transform="translate(115.38,-142.451)" v:mid="92" v:groupcontext="group">		<title>Sheet.92</title>		<g id="shape93-158" v:mid="93" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.93</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape94-161" v:mid="94" v:groupcontext="shape" transform="translate(8.33125,2.84217E-14)">			<title>Sheet.94</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape95-163" v:mid="95" v:groupcontext="shape" transform="translate(42.8586,-145.443)">		<title>Sheet.95</title>		<path d="M0 214.7 L9.31 214.7" class="st7"></path>	</g>	<g id="shape96-166" v:mid="96" v:groupcontext="shape" transform="translate(128.944,-123.393)">		<title>Sheet.96</title>		<desc>audiobuffersplit</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="34.9125" cy="192.651" width="69.83" height="44.1"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L66.83 214.7 A3.00007 3.00007 -180 0 0 69.83 211.7 L69.83 173.6 A3.00007					 3.00007 -180 0 0 66.83 170.6 L3 170.6 A3.00007 3.00007 -180 0 0 0 173.6 L0 211.7 Z" class="st3"></path>		<text x="3.25" y="196.25" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>audiobuffersplit</text>		</g>	<g id="group97-169" transform="translate(198.769,-142.451)" v:mid="97" v:groupcontext="group">		<title>Sheet.97</title>		<g id="shape98-170" v:mid="98" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.98</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape99-173" v:mid="99" v:groupcontext="shape" transform="translate(8.33124,2.84217E-14)">			<title>Sheet.99</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape100-175" v:mid="100" v:groupcontext="shape" transform="translate(212.332,-123.393)">		<title>Sheet.100</title>		<desc>qtimlaconverter</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="46.1625" cy="192.651" width="92.33" height="44.1"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L89.33 214.7 A3.00007 3.00007 -180 0 0 92.33 211.7 L92.33 173.6 A3.00007					 3.00007 -180 0 0 89.33 170.6 L3 170.6 A3.00007 3.00007 -180 0 0 -0 173.6 L0 211.7 Z" class="st9"></path>		<text x="14.69" y="196.25" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlaconverter</text>		</g>	<g id="group101-178" transform="translate(304.657,-142.451)" v:mid="101" v:groupcontext="group">		<title>Sheet.101</title>		<g id="shape102-179" v:mid="102" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.102</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape103-182" v:mid="103" v:groupcontext="shape" transform="translate(8.33124,2.84217E-14)">			<title>Sheet.103</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape104-184" v:mid="104" v:groupcontext="shape" transform="translate(318.22,-123.393)">		<title>Sheet.104</title>		<desc>qtimflite</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="34.9125" cy="192.651" width="69.83" height="44.1"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L66.82 214.7 A3.00007 3.00007 -180 0 0 69.83 211.7 L69.83 173.6 A3.00007					 3.00007 -180 0 0 66.82 170.6 L3 170.6 A3.00007 3.00007 -180 0 0 0 173.6 L0 211.7 Z" class="st9"></path>		<text x="18.25" y="196.25" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimflite</text>		</g>	<g id="group105-187" transform="translate(388.045,-142.451)" v:mid="105" v:groupcontext="group">		<title>Sheet.105</title>		<g id="shape106-188" v:mid="106" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.106</title>			<path d="M0 214.7 L9.21 214.7" class="st7"></path>		</g>		<g id="shape107-191" v:mid="107" v:groupcontext="shape" transform="translate(8.33124,2.84217E-14)">			<title>Sheet.107</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape112-193" v:mid="112" v:groupcontext="shape" transform="translate(401.158,-123.393)">		<title>Sheet.112</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="53.6625" cy="192.651" width="107.33" height="44.1"></v:textrect>		<path d="M0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L104.33 214.7 A3.00007 3.00007 -180 0 0 107.33 211.7 L107.32 173.6					 A3.00007 3.00007 -180 0 0 104.33 170.6 L3 170.6 A3.00007 3.00007 -180 0 0 0 173.6 L0 211.7 Z" class="st9"></path>		<text x="18.63" y="196.25" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="group113-196" transform="translate(508.483,-142.451)" v:mid="113" v:groupcontext="group">		<title>Sheet.113</title>		<g id="shape114-197" v:mid="114" v:groupcontext="shape" transform="translate(0,-2.99179)">			<title>Sheet.114</title>			<path d="M0 214.7 L501.07 214.7" class="st7"></path>		</g>		<g id="shape115-200" v:mid="115" v:groupcontext="shape" transform="translate(500.198,2.84217E-14)">			<title>Sheet.115</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="shape117-202" v:mid="117" v:groupcontext="shape" transform="translate(832.533,-43.5)">		<title>Sheet.117</title>		<desc>qtimlpostprocess</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="45" cy="199.701" width="90" height="30"></v:textrect>		<path d="M-0 211.7 A3.00007 3.00007 -180 0 0 3 214.7 L87 214.7 A3.00007 3.00007 -180 0 0 90 211.7 L90 187.7 A3.00007					 3.00007 -180 0 0 87 184.7 L3 184.7 A3.00007 3.00007 -180 0 0 -0 187.7 L0 211.7 Z" class="st9"></path>		<text x="9.97" y="203.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>qtimlpostprocess</text>		</g>	<g id="shape119-205" v:mid="119" v:groupcontext="shape" transform="translate(1260.68,40.6062) rotate(90)">		<title>Sheet.119</title>		<path d="M0 214.7 L8.07 214.7" class="st7"></path>	</g>	<g id="group120-208" transform="translate(1000.68,-68.5036)" v:mid="120" v:groupcontext="group">		<title>Sheet.120</title>		<g id="shape121-209" v:mid="121" v:groupcontext="shape" transform="translate(0,-2.99181)">			<title>Sheet.121</title>			<path d="M0 214.7 L8.88 214.7" class="st7"></path>		</g>		<g id="shape122-212" v:mid="122" v:groupcontext="shape" transform="translate(8.00478,2.84217E-14)">			<title>Sheet.122</title>			<path d="M0 214.7 L5.18 211.71 L0 208.72 L0 214.7 Z" class="st8"></path>		</g>	</g>	<g id="group124-214" transform="translate(975.719,-11.7814)" v:mid="124" v:groupcontext="group">		<title>Sheet.124</title>		<g id="shape7-215" v:mid="7" v:groupcontext="shape" transform="translate(15.1883,0)">			<title>Sheet.7</title>			<desc>Qualcomm</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="26.855" cy="208.401" width="53.71" height="12.6"></v:textrect>			<rect x="0" y="202.101" width="53.71" height="12.6" class="st12"></rect>			<text x="0" y="211.1" class="st13" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm  </text>			</g>		<g id="shape8-218" v:mid="8" v:groupcontext="shape" transform="translate(6.29496E-14,-0.218622)">			<title>Sheet.8</title>			<path d="M0 213.2 A1.50003 1.50003 -180 0 0 1.5 214.7 L10.5 214.7 A1.50003 1.50003 -180 0 0 12 213.2 L12 204.2 A1.50003						 1.50003 -180 0 0 10.5 202.7 L1.5 202.7 A1.50003 1.50003 -180 0 0 0 204.2 L0 213.2 Z" class="st9"></path>		</g>		<g id="shape10-220" v:mid="10" v:groupcontext="shape" transform="translate(81.3204,0)">			<title>Sheet.10</title>			<desc>开源</desc>			<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>			<v:textrect cx="10.5273" cy="208.401" width="21.06" height="12.6"></v:textrect>			<rect x="0" y="202.101" width="21.0546" height="12.6" class="st12"></rect>			<text x="0" y="211.4" class="st14" v:langid="1033"><v:paragraph></v:paragraph><v:tablist></v:tablist>开源</text>			</g>		<g id="shape11-223" v:mid="11" v:groupcontext="shape" transform="translate(66.1322,-0.218622)">			<title>Sheet.11</title>			<path d="M0 213.2 A1.50003 1.50003 -180 0 0 1.5 214.7 L10.5 214.7 A1.50003 1.50003 -180 0 0 12 213.2 L12 204.2 A1.50003						 1.50003 -180 0 0 10.5 202.7 L1.5 202.7 A1.50003 1.50003 -180 0 0 0 204.2 L0 213.2 Z" class="st3"></path>		</g>	</g></g>
</svg>

## 示例模型和标签文件

Table : gst-ai-audio-classification 的示例模型和标签文件

| Runtime | 模型文件 | 标签文件 |
| :--- | :--- | :--- |
| LiteRT | <var class="keyword varname">yamnet.tflite</var> | <var class="keyword varname">yamnet.json</var> |

## 在目标设备上运行应用程序

示例应用程序使用 /etc/configs/config-audio-classification.json文件读取输入参数。

要创建自己的 config JSON 文件，请使用 [config-audio-classification.json](https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/gst-plugins-qti-oss/-/blob/imsdk.lnx.2.0.0.r2-rel/gst-sample-apps/gst-ai-audio-classification/config-audio-classification.json?ref_type=heads) 作为参考。

1. 确保您已完成[前提条件](https://docs.qualcomm.com/doc/80-70022-50SC/topic/download-model-and-label-files.html)。
2. 根据模型、输入流和其他属性更新 config JSON 文件。关于更多详细信息，请参阅 [Config JSON 字段说明](https://docs.qualcomm.com/doc/80-70022-50SC/topic/audio-classification.html#audio-classification__section_lcw_2zj_32c)。
3. 使用以下格式的 config-audio-classification.json文件。

        {
          "file-path": "<path to video file>",
          "model": "<path to model file>",
          "labels": "<path to label file>",
          "threshold": <integer between 1 and 100>,
          "runtime": "<cpu or gpu>",
          "codec": "<mp3 or flac>"
        }Copy to clipboard

例如，使用文件输入、MP3 编码和 GPU runtime 运行应用程序：

        {
        "file-path": "/etc/media/video-mp3.mp4", 
        "model": "/etc/models/yamnet.tflite", 
        "labels": "/etc/labels/yamnet.json",
        "runtime": "cpu",
        "threshold": 20,
        "codec": "mp3"
        }Copy to clipboard
4. 运行 gst-ai-audio-classification 应用程序：

        gst-ai-audio-classification --config-file=/etc/configs/config-audio-classification.jsonCopy to clipboard
5. 要显示可用的帮助选项，请在 SSH shell 中运行以下命令：

        gst-ai-audio-classification -hCopy to clipboard
6. 要停止用例，请按 CTRL +
                    C。

## 预期输出

输出视频和分类音频将在屏幕上播放。

## Pipeline 流

下表列出了音频分类 pipeline 中使用的插件：| 插件 | 说明 |
| --- | --- |
| 文件源：filesrc | <ul class="ul" id="audio-classification__ul_z1z_x4f_w1c"><br>                                    <li class="li">使用 filesrc 采集视频流，然后使用 qtdemux 对视频流进行解复用。</li><br><br>                                    <li class="li">使用 tee 拆分流进行推理。</li><br><br>                                </ul> |
| h264parse | 渲染 H.264 视频。 |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70022-50SC/topic/v4l2h264dec.html) | 解码视频 |
| mpegaudioparse 或 flacparse | 解析音频（MP3 或 FLAC）。 |
| mpg123audiodec 或 flacdec | 解码音频（MP3 或 FLAC）。 |
| audioconvert | 对音频缓存在各种可能的格式之间进行转换。 |
| audioresample | 将音频缓存以不同的采样率进行重采样。 |
| [pulsesrc](https://docs.qualcomm.com/doc/80-70022-50SC/topic/pulsesrc.html) | 从麦克风采集音频。 |
| audiobuffersplit | 将传入的音频缓存分割为大小相等的块。 |
| [qtimlaconverter](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimlaconverter.html) | 对音频流执行预处理，并将其转换为张量流。<br>音频分类模型使用该张量流进行推理。 |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtimltflite.html) | 使用 YAMNet 模型执行推理。 |
| qtimlpostprocess | 使用 yamnet 模块处理音频分类推理结果：<ol class="ol" id="audio-classification__ol_ol3_dky_kbc"><br>                                    <li class="li">将阈值应用于所选结果数。</li><br><br>                                    <li class="li">为分类创建文本叠加。</li><br><br>                                </ol> |
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70022-50SC/topic/qtivcomposer.html) | 将分类结果的文本叠加与视频预览合并。 |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70022-50SC/topic/waylandsink.html) | <ol class="ol" id="audio-classification__ol_kjr_fvr_lbc"><br>                                    <li class="li">Waylandsink 将其接收端口上接收的视频流提交给 Weston。</li><br><br>                                    <li class="li">Weston 在本地显示器上渲染视频流。</li><br><br>                                </ol> |

## Config JSON 字段说明

可用于配置 JSON 文件和运行用例的不同参数如下：

| 字段 | 值/描述 |
| :--- | :--- |
| **runtime** | 请使用以下 runtime 之一：<ul class="ul" id="audio-classification__ul_mry_nck_32c"><br>                                    <li class="li"><code class="ph codeph">cpu</code></li><br><br>                                    <li class="li"><code class="ph codeph">gpu</code></li><br><br>                                </ul> |
| **Input source** | 请使用以下输入源之一：<ul class="ul" id="audio-classification__ul_xym_rck_32c"><br>                                    <li class="li"><code class="ph codeph">file-path</code>：视频文件的目录路径。</li><br><br>                                    <li class="li">麦克风</li><br><br>                                </ul> |
| **threshold=&lt;integer&gt;** | 使用 1 到 100 之间的任意整数。 |
| **codec** | 输入视频的音频 codec：<ul class="ul" id="audio-classification__ul_q3j_qqz_n2c"><br>                                    <li class="li">MP3（默认）</li><br><br>                                    <li class="li">FLAC</li><br><br>                                </ul> |

## 相关信息

[使用 LiteRT 进行音频分类解码与显示](https://docs.qualcomm.com/doc/80-70022-50SC/topic/audio-classification-with-litert.html)

**Parent Topic:** [运行 AI/ML 示例应用程序](https://docs.qualcomm.com/doc/80-70022-50SC/topic/ai-ml-sample-applications.html)

Last Published: Nov 05, 2025

[Previous Topic
人脸识别](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/gst-ai-face-recognition.md) [Next Topic
元数据解析](https://docs.qualcomm.com/bundle/publicresource/80-70022-50SC/topics/gst-ai-metadata-parser.md)