Qt中的跨平台麦克风音频处理实用程序

  • R6_115093
    了解作者
  • 373.9KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-03 04:51
    上传日期
简单的信号处理实现到麦克风音频
421287.zip
  • Cross-Platform-Microphone-Audio-Processing-Utility.pdf
    74.8KB
  • MicroPhoneAudio.zip
    318.1KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6248b756ce850076c9a32df0/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6248b756ce850076c9a32df0/bg1.jpg"><div class="c x1 y1 w2 h2"><div class="t m0 x2 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Qt<span class="ff2">&#20013;<span class="_ _0"></span>&#30340;&#36328;<span class="_ _0"></span>&#24179;&#21488;&#40614;<span class="_ _0"></span>&#20811;&#39118;<span class="_ _0"></span>&#38899;&#39057;<span class="_ _0"></span>&#22788;&#29702;&#23454;<span class="_ _0"></span>&#29992;&#31243;<span class="_ _0"></span>&#24207;<span class="_ _1"></span>&#20013;&#30340;<span class="_ _0"></span>&#36328;&#24179;&#21488;<span class="_ _0"></span>&#40614;&#20811;<span class="_ _0"></span>&#39118;&#38899;<span class="_ _0"></span>&#39057;&#22788;&#29702;<span class="_ _0"></span>&#23454;&#29992;<span class="_ _0"></span>&#31243;&#24207;<span class="_ _2"></span><span class="ff1">-</span>&#28304;&#30721;<span class="_ _3"></span>&#28304;&#30721;</span></div><div class="t m0 x2 h4 y3 ff2 fs1 fc0 sc0 ls0 ws0">&#20171;&#32461;<span class="_ _4"></span>&#20171;&#32461;</div><div class="t m0 x2 h5 y4 ff2 fs2 fc0 sc0 ls0 ws0">&#26412;&#25991;&#20171;&#32461;<span class="_ _0"></span>&#20102;&#22914;&#20309;&#35760;&#24405;<span class="_ _0"></span>&#26469;&#33258;&#40614;&#20811;<span class="_ _0"></span>&#39118;&#30340;&#38899;&#39057;&#20197;<span class="_ _0"></span>&#21450;&#22914;&#20309;&#20351;&#29992;<span class="_ _0"></span><span class="ff3">DSP</span>&#31639;&#27861;&#22788;<span class="_ _0"></span>&#29702;&#38899;&#39057;&#26679;&#26412;<span class="_ _0"></span>&#12290;<span class="ff3"> </span>&#22312;&#26412;&#25991;&#20013;&#65292;<span class="_ _0"></span>&#25105;&#23558;&#20351;</div><div class="t m0 x2 h5 y5 ff2 fs2 fc0 sc0 ls0 ws0">&#29992;<span class="ff3 fs3">QAudio<span class="_ _0"></span>Input</span>&#21644;<span class="ff3 fs3">Q<span class="_ _0"></span>AudioOutput</span>&#31867;&#26469;&#35760;<span class="_ _0"></span>&#24405;&#21644;&#25773;&#25918;<span class="_ _0"></span>&#36755;&#20837;&#38899;&#39057;&#65292;<span class="_ _0"></span>&#24182;&#20351;&#29992;&#20302;&#36890;<span class="_ _0"></span>&#28388;&#27874;&#22120;&#31639;&#27861;<span class="_ _0"></span>&#26469;&#20943;&#23569;&#36755;<span class="_ _0"></span>&#20837;&#38899;&#39057;&#20013;&#30340;<span class="_ _0"></span>&#22122;&#22768;&#12290;<span class="ff3"> </span>&#22312;&#36825;<span class="_ _0"></span>&#37324;&#65292;&#25105;&#35797;&#22270;</div><div class="t m0 x2 h5 y6 ff2 fs2 fc0 sc0 ls0 ws0">&#35299;&#37322;&#20351;&#29992;<span class="_ _0"></span><span class="ff3">Qt</span>&#36827;&#34892;&#30340;<span class="_ _0"></span>&#20302;&#32423;&#38899;&#39057;&#22788;<span class="_ _0"></span>&#29702;&#12290;<span class="ff3"> </span>&#22312;&#36825;<span class="_ _0"></span>&#37324;&#65292;&#25105;&#19981;&#35299;<span class="_ _0"></span>&#37322;&#20219;&#20309;&#22797;&#26434;<span class="_ _0"></span>&#30340;<span class="ff3">DSP</span>&#31639;&#27861;<span class="_ _0"></span>&#12290;<span class="ff3"> </span>&#36825;&#21482;&#26159;&#26356;&#22909;<span class="_ _0"></span>&#30340;&#36328;&#24179;&#21488;<span class="_ _0"></span>&#38899;&#39057;&#22788;&#29702;&#23454;<span class="_ _0"></span>&#29992;&#31243;&#24207;&#30340;&#36215;<span class="_ _0"></span>&#28857;&#12290;</div><div class="t m0 x2 h5 y7 ff2 fs2 fc0 sc0 ls0 ws0">&#24744;&#21487;&#20197;&#23454;<span class="_ _0"></span>&#29616;&#33258;&#24049;&#30340;&#31639;<span class="_ _0"></span>&#27861;&#25110;&#20219;&#20309;<span class="_ _0"></span>&#22797;&#26434;&#30340;&#31639;&#27861;<span class="_ _0"></span>&#26469;&#25193;&#23637;&#24744;&#30340;<span class="_ _0"></span>&#24819;&#27861;&#12290;<span class="ff3"> </span>&#25105;&#20351;<span class="_ _0"></span>&#29992;<span class="ff3">Qt</span>&#30340;&#38899;&#39057;<span class="_ _0"></span>&#36755;&#20837;&#21644;&#38899;<span class="_ _0"></span>&#39057;&#36755;&#20986;&#31034;&#20363;<span class="_ _0"></span>&#26469;&#24320;&#21457;&#27492;&#23454;<span class="_ _0"></span>&#29992;&#31243;&#24207;&#12290;</div><div class="t m0 x2 h4 y8 ff2 fs1 fc0 sc0 ls0 ws0">&#32972;&#26223;<span class="_ _4"></span>&#32972;&#26223;</div><div class="t m0 x2 h5 y9 ff2 fs2 fc0 sc0 ls0 ws0">&#22312;&#25105;&#26368;&#36817;<span class="_ _0"></span>&#30340;&#39033;&#30446;&#20013;&#65292;<span class="_ _0"></span>&#25105;&#36935;&#21040;&#20102;<span class="_ _0"></span>&#19968;&#20123;&#38382;&#39064;&#65292;<span class="_ _0"></span>&#26080;&#27861;&#21516;&#26102;&#35760;<span class="_ _0"></span>&#24405;&#38899;&#39057;&#21644;&#25773;<span class="_ _0"></span>&#25918;&#12290;<span class="ff3"> </span>&#25105;&#22312;&#32593;<span class="_ _0"></span>&#19978;&#25628;&#32034;&#23427;&#65292;<span class="_ _0"></span>&#30475;&#21040;&#24456;&#22810;<span class="_ _0"></span>&#35770;&#22363;&#37117;&#22312;&#35752;<span class="_ _0"></span>&#35770;&#22914;&#20309;&#25429;&#33719;<span class="_ _0"></span>&#38899;&#39057;</div><div class="t m0 x2 h5 ya ff2 fs2 fc0 sc0 ls0 ws0">&#24182;&#19968;&#27425;&#25773;<span class="_ _0"></span>&#25918;&#32473;&#25196;&#22768;&#22120;<span class="_ _0"></span>&#12290;<span class="ff3"> </span>&#27809;&#26377;&#20154;&#32473;<span class="_ _0"></span>&#20986;&#20351;&#29992;<span class="ff3">Qt<span class="_ _0"></span></span>&#36827;&#34892;&#27492;&#25805;&#20316;<span class="_ _0"></span>&#30340;&#27491;&#30830;&#31572;&#26696;<span class="_ _0"></span>&#12290;<span class="ff3"> </span>&#32463;&#36807;&#19968;<span class="_ _0"></span>&#20123;&#30740;&#31350;&#24037;&#20316;<span class="_ _0"></span>&#65292;&#25105;&#32456;&#20110;<span class="_ _0"></span>&#25104;&#21151;&#22320;&#19968;&#27425;<span class="_ _0"></span>&#24405;&#21046;&#21644;&#25773;&#25918;<span class="_ _0"></span>&#38899;&#39057;&#12290;</div><div class="t m0 x2 h4 yb ff2 fs1 fc0 sc0 ls0 ws0">&#20351;&#29992;&#20195;<span class="_ _0"></span>&#30721;<span class="_ _5"></span>&#20351;&#29992;&#20195;<span class="_ _0"></span>&#30721;</div><div class="t m0 x2 h5 yc ff3 fs2 fc0 sc0 ls0 ws0">TARGET<span class="_ _0"></span><span class="ff2">&#25351;&#23450;&#36755;&#20986;&#25991;<span class="_ _0"></span>&#20214;&#21517;&#65288;</span>TAR<span class="_ _0"></span>GET = Ap<span class="_ _0"></span>plicationNa<span class="_ _0"></span>me<span class="ff2">&#65289;</span></div><div class="t m0 x2 h5 yd ff3 fs2 fc0 sc0 ls0 ws0">TEMPLA<span class="_ _0"></span>TE<span class="ff2">&#25351;&#23450;&#20854;&#32534;<span class="_ _0"></span>&#35793;&#36755;&#20986;&#31867;&#22411;<span class="_ _0"></span>&#12290;</span> <span class="ff2">&#23558;&#20854;&#20998;&#37197;<span class="_ _0"></span>&#32473;&#19968;&#20010;&#24212;&#29992;<span class="_ _0"></span>&#31243;&#24207;&#65288;</span>TE<span class="_ _0"></span>MPLATE =<span class="_ _0"></span> app<span class="ff2">&#65289;</span></div><div class="t m0 x2 h5 ye ff2 fs2 fc0 sc0 ls0 ws0">&#28155;&#21152;&#39033;&#30446;<span class="_ _0"></span>&#20013;&#27491;&#22312;&#20351;&#29992;<span class="_ _0"></span>&#30340;&#25152;&#26377;&#28304;<span class="_ _0"></span>&#25991;&#20214;&#21644;&#22836;&#25991;<span class="_ _0"></span>&#20214;&#12290;</div><div class="t m0 x2 h5 yf ff2 fs2 fc0 sc0 ls0 ws0">&#23558;&#34920;&#21333;&#35774;<span class="_ _0"></span>&#35745;&#36164;&#28304;&#28155;&#21152;<span class="_ _0"></span>&#21040;<span class="ff3">FORMS<span class="_ _0"></span> + = mai<span class="_ _0"></span>nwindow.u<span class="_ _0"></span>i</span>&#12290;<span class="_ _6"></span><span class="ff3"> <span class="ff2">&#36825;&#23558;&#20026;&#24744;<span class="_ _0"></span>&#30340;&#24212;&#29992;&#31243;&#24207;<span class="_ _0"></span>&#21019;&#24314;&#29992;&#25143;&#30028;<span class="_ _0"></span>&#38754;</span></span></div><div class="t m0 x2 h5 y10 ff2 fs2 fc0 sc0 ls0 ws0">&#22312;<span class="ff3">Qt Cr<span class="_ _0"></span>eator</span>&#20013;&#65292;&#21551;<span class="_ _0"></span>&#21160;&#19968;&#20010;&#26032;<span class="_ _0"></span>&#30340;<span class="ff3">Qt Widge<span class="_ _0"></span>t</span>&#39033;&#30446;&#12290;<span class="_ _0"></span><span class="ff3"> </span>&#35813;&#21521;&#23548;<span class="_ _0"></span>&#23558;&#21019;&#24314;&#25152;&#26377;<span class="_ _0"></span>&#24517;&#35201;&#30340;&#25991;&#20214;<span class="_ _0"></span>&#20197;&#21551;&#21160;&#26700;<span class="_ _0"></span>&#38754;&#24212;&#29992;&#31243;&#24207;<span class="_ _0"></span>&#12290;<span class="ff3"> </span>&#21040;</div><div class="t m0 x2 h5 y11 ff2 fs2 fc0 sc0 ls0 ws0">&#38142;&#25509;&#21040;&#22810;<span class="_ _0"></span>&#23186;&#20307;&#27169;&#22359;&#65292;<span class="_ _0"></span>&#23558;<span class="ff3">QT + =<span class="_ _0"></span></span>&#22810;&#23186;&#20307;&#34892;<span class="_ _0"></span>&#28155;&#21152;&#21040;&#24744;&#30340;<span class="_ _0"></span><span class="ff3">AppNama<span class="_ _0"></span>e .pro</span>&#25991;&#20214;<span class="_ _0"></span>&#20013;&#65306;</div><div class="t m0 x2 h6 y12 ff3 fs3 fc0 sc0 ls0 ws0">QT +<span class="_ _0"></span>= core gui</div><div class="t m0 x2 h6 y13 ff3 fs3 fc0 sc0 ls0 ws0"> m<span class="_ _0"></span>ultimedia</div><div class="t m0 x2 h6 y14 ff3 fs3 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h6 y15 ff3 fs3 fc0 sc0 ls0 ws0">TARGET =<span class="_ _0"></span> MyAudio</div><div class="t m0 x2 h6 y16 ff3 fs3 fc0 sc0 ls0 ws0">TEMPLATE<span class="_ _0"></span> = app</div><div class="t m0 x2 h6 y17 ff3 fs3 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h6 y18 ff3 fs3 fc0 sc0 ls0 ws0">SOURCES<span class="_ _0"></span> += main.cp<span class="_ _0"></span>p</div><div class="t m0 x2 h6 y19 ff3 fs3 fc0 sc0 ls0 ws0"> main<span class="_ _0"></span>window.cpp</div><div class="t m0 x2 h6 y1a ff3 fs3 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h6 y1b ff3 fs3 fc0 sc0 ls0 ws0">HEADERS<span class="_ _0"></span> += mainwi<span class="_ _0"></span>ndow.h</div><div class="t m0 x2 h6 y1c ff3 fs3 fc0 sc0 ls0 ws0">FORMS <span class="_ _0"></span>+= mainwin<span class="_ _0"></span>dow.ui</div><div class="t m0 x2 h5 y1d ff2 fs2 fc0 sc0 ls0 ws0">&#22312;&#24320;&#22987;&#38899;<span class="_ _0"></span>&#39057;&#22788;&#29702;&#20043;&#21069;<span class="_ _0"></span>&#65292;&#35831;&#21021;&#22987;<span class="_ _0"></span>&#21270;&#38899;&#39057;&#26684;&#24335;<span class="_ _0"></span>&#30340;&#39057;&#29575;&#65292;&#36890;<span class="_ _0"></span>&#36947;&#65292;&#37319;&#26679;&#29575;<span class="_ _0"></span>&#31561;&#12290;&#20351;&#29992;<span class="_ _0"></span><span class="ff3 fs3">QAudioForma<span class="_ _0"></span>t</span>&#21021;&#22987;<span class="_ _0"></span>&#21270;&#38899;&#39057;&#12290;</div><div class="t m0 x2 h5 y1e ff2 fs2 fc0 sc0 ls0 ws0">&#38899;&#39057;&#26684;&#24335;<span class="_ _0"></span>&#25351;&#23450;&#22914;&#20309;&#23433;<span class="_ _0"></span>&#25490;&#38899;&#39057;&#27969;<span class="_ _0"></span>&#20013;&#30340;&#25968;&#25454;&#65292;<span class="_ _0"></span>&#21363;&#22914;&#20309;&#35299;&#37322;<span class="_ _0"></span>&#35813;&#27969;&#12290;<span class="ff3"> </span>&#32534;&#30721;<span class="_ _0"></span>&#26412;&#36523;&#30001;&#29992;&#20110;<span class="_ _0"></span>&#27969;&#30340;<span class="ff3 fs3">codec<span class="_ _0"></span>()</span>&#25351;<span class="_ _0"></span>&#23450;&#12290;</div><div class="t m0 x2 h5 y1f ff2 fs2 fc0 sc0 ls0 ws0">&#38500;&#20102;&#32534;&#30721;<span class="_ _0"></span>&#20043;&#22806;&#65292;<span class="ff3"> <span class="fs3">QAu<span class="_ _0"></span>dioFormat<span class="_ _0"></span></span></span>&#21253;&#21547;&#20854;<span class="_ _0"></span>&#20182;&#21442;&#25968;&#65292;&#36825;<span class="_ _0"></span>&#20123;&#21442;&#25968;&#36827;&#19968;<span class="_ _0"></span>&#27493;&#25351;&#23450;&#20102;&#38899;<span class="_ _0"></span>&#39057;&#25968;&#25454;&#30340;<span class="_ _0"></span>&#25490;&#21015;&#26041;&#24335;&#12290;<span class="_ _0"></span><span class="ff3"> </span>&#36825;&#20123;&#26159;&#39057;&#29575;<span class="_ _0"></span>&#65292;&#36890;&#36947;&#25968;&#65292;<span class="_ _0"></span>&#26679;&#26412;&#22823;</div><div class="t m0 x2 h5 y20 ff2 fs2 fc0 sc0 ls0 ws0">&#23567;&#65292;&#26679;&#26412;<span class="_ _0"></span>&#31867;&#22411;&#21644;&#23383;&#33410;<span class="_ _0"></span>&#39034;&#24207;&#12290;<span class="ff3"> </span>&#19979;&#34920;<span class="_ _0"></span>&#26356;&#35814;&#32454;&#22320;<span class="_ _0"></span>&#25551;&#36848;&#20102;&#36825;&#20123;</div><div class="t m0 x2 h7 y21 ff3 fs2 fc0 sc0 ls0 ws0">C ++</div><div class="t m0 x2 h6 y22 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setFrequenc<span class="_ _0"></span>y( 8000 ); //<span class="_ _0"></span> set freque<span class="_ _0"></span>ncy to 8000</div><div class="t m0 x2 h6 y23 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setChannels(<span class="_ _0"></span> 1 ); //<span class="_ _0"></span> set channels to<span class="_ _0"></span> mono</div><div class="t m0 x2 h6 y24 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setSampleS<span class="_ _0"></span>ize( 16 );<span class="_ _0"></span> //<span class="_ _0"></span> set sample sze<span class="_ _0"></span> to 16 bit</div><div class="t m0 x2 h6 y25 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setSampleT<span class="_ _0"></span>ype(QAudioFo<span class="_ _0"></span>rmat::UnSign<span class="_ _0"></span>edInt ); //<span class="_ _0"></span> Sample typ<span class="_ _0"></span>e as usigned<span class="_ _0"></span> integer samp<span class="_ _0"></span>le</div><div class="t m0 x2 h6 y26 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setByteOrde<span class="_ _0"></span>r(QAudioForm<span class="_ _0"></span>at::LittleEndi<span class="_ _0"></span>an); /<span class="_ _0"></span>/ Byte orde<span class="_ _0"></span>r</div><div class="t m0 x2 h6 y27 ff3 fs3 fc0 sc0 ls0 ws0">m_forma<span class="_ _0"></span>t.setCodec( " audio/p<span class="_ _0"></span>cm" ); // set <span class="_ _0"></span>codec as sim<span class="_ _0"></span>ple audio/pcm</div><div class="t m0 x2 h6 y28 ff3 fs3 fc0 sc0 ls0 ws0">QAudioDe<span class="_ _0"></span>viceInfo infoIn<span class="_ _0"></span>(QAudioDevic<span class="_ _0"></span>eInfo::default<span class="_ _0"></span>InputDevice()<span class="_ _0"></span>);</div><div class="t m0 x2 h6 y29 ff3 fs3 fc0 sc0 ls0 ws0">if (!infoIn.isFor<span class="_ _0"></span>matSupporte<span class="_ _0"></span>d(m_format)<span class="_ _0"></span>)</div><div class="t m0 x2 h6 y2a ff3 fs3 fc0 sc0 ls0 ws0">{</div><div class="t m0 x2 h6 y2b ff3 fs3 fc0 sc0 ls0 ws0"> <span class="_ _0"></span>// Defa<span class="_ _0"></span>ult format no<span class="_ _0"></span>t supported - <span class="_ _0"></span>trying to use<span class="_ _0"></span> nearest</div><div class="t m0 x2 h6 y2c ff3 fs3 fc0 sc0 ls0 ws0"> m_form<span class="_ _0"></span>at = infoIn.n<span class="_ _0"></span>earestFormat<span class="_ _0"></span>(m_format);</div><div class="t m0 x2 h6 y2d ff3 fs3 fc0 sc0 ls0 ws0">}</div><div class="t m0 x2 h6 y2e ff3 fs3 fc0 sc0 ls0 ws0">QAudioDe<span class="_ _0"></span>viceInfo infoO<span class="_ _0"></span>ut(QAudioDe<span class="_ _0"></span>viceInfo::defau<span class="_ _0"></span>ltOutputDevi<span class="_ _0"></span>ce());</div><div class="t m0 x2 h6 y2f ff3 fs3 fc0 sc0 ls0 ws0">if (!infoOut.isF<span class="_ _0"></span>ormatSuppor<span class="_ _0"></span>ted(m_forma<span class="_ _0"></span>t))</div><div class="t m0 x2 h6 y30 ff3 fs3 fc0 sc0 ls0 ws0">{</div><div class="t m0 x2 h6 y31 ff3 fs3 fc0 sc0 ls0 ws0"> // Default form<span class="_ _0"></span>at not suppo<span class="_ _0"></span>rted - trying<span class="_ _0"></span> to use neares<span class="_ _0"></span>t</div><div class="t m0 x2 h6 y32 ff3 fs3 fc0 sc0 ls0 ws0"> m_form<span class="_ _0"></span>at = infoOut<span class="_ _0"></span>.nearestForm<span class="_ _0"></span>at(m_format)<span class="_ _0"></span>;</div><div class="t m0 x2 h6 y33 ff3 fs3 fc0 sc0 ls0 ws0">}</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐