ÎÒÕâÈË´ÓСÓиö»µÃ«²¡£¬¾ÍÊÇϲ»¶Íµ¿ú±ðÈËÒþ˽¡£µ±È»£¬ÔÚµÀµÂÉÏ£¬ÎÒʱ¿ÌÒªÇó×Ô¼º×öÒ»ÃûÕýÈ˾ý×Ó£¬Ö»²»¹ýÊÇÐÄÀíÉÏÓÐÕâñ±ºÃ°ÕÁË¡£ËùÒÔÎÒ´ÓС¾Í¶ÔÇÔÌý¡¢ÇÔÊÓ¡¢ºÚ¿Í¼¼Êõ¡¢Æƽ⼼ÊõµÈ·è¿ñ×ÅÃÔ£¡Êµ¼ÊÉÏÕâÒ²ÊÇÎÒ×ßÉϳÌÐòԱ֮·µÄÒ»¸öÖØÒªÔÒò£¡
È¥Ä꣬¿ËÇ¿×ÜÀíÀ´ÎÒ˾ÊÓ²ìµÄʱºò£¬¾Í±íʾ¶ÔÈ˹¤ÖÇÄܼÄÓèºñÍû¡£µ±Ê±£¬ÎÒÒ»Ãæ¶ãÔÚÈËȺÖÐÓÃÊÖ»ú͵ÅÄ£¬Ò»Ãæ°µ°µÏÂÁ˾öÐÄ¡£
ÆäʵÎÒÒ»Ö±¾ÍÓÐÒ»¸öΰ´óµÄ¼Æ»®£¬´ó¸Åµ®ÉúÓÚÆßÄêÇ°£¬ÄǾÍÊÇ¿ª·¢Ò»¿îÇÔÌýÈí¼þ£¬¿ªÆôÈ«Ãñʱ´úµÄÇÔÌý·çÔÆ£¡
¿ÉϧÄÇÆßÄ꣬ËùÓеÄÐÄÁ¦¶¼¸¶Öî·¿´û£¬´ó¿ÚÍÌÑÊ×ÅÑÛÇ°µÄ¹¶ÇÒ£¬ÄÄ»¹ÓÐϾÄî¼°Ê«ºÍÔ¶·½£¿¡ª¡ªÃÎÏë²Ò±»¸édz£¡
Èç½ñÖÕÓÚÔÚÉϺ£ÓµÓÐÁË×Ô¼ºµÄ²»¶¯²ú£¬ÓÖÇ¡·êÖйú¾¼Ãµ÷½á¹¹¡¢´Ù·¢Õ¹¡¢Ð¾ɶ¯ÄÜ´óת»»¡¢´óÖÚ´´ÒµÍòÖÚ´´Ð¡ª¡ª¿´À´Ê±ÊÆÔìÓ¢ÐÛ£¬ÊÇʱºò´óÕ¹ÉíÊÖ¸ãÒ»¸ö´óÐÂÎÅÁË!
ÕýºÃºóÀ´ÔÚÔ°×ÓÀïÕÒµ½ÁËһƪ£ºÊµÏÖÓïÒôÊÓƵ¼ÖÆ£¨demoÔ´Â룩
ÓÚÊÇÑо¿ÁËÒ»¶Îʱ¼ä£¬ÖÕÓÚÈçÔ¸ÒÔ³¥µÄд³öÁË×Ô¼ºµÄÇÔÌýÉñÆ÷£¡
¡¤ÔÀíÓëʵÏÖ
³ÖÐø²É¼¯Âó¿Ë·çµÃµ½ÒôƵ֡£¬È»ºó¸ù¾Ý¸µÀïÒ¶±ä»»µÃ³öÒôƵ֡µÄÏì¶È´óС¡£µ±Ïì¶È´óÓÚÖ¸¶¨ÖµÊ±£¬¿ªÆô¼ÖÆ¡ª¡ª½«ÒôƵ֡дÈëMP3Îļþ£»µ±Ïì¶ÈµÍÓÚÖ¸¶¨ÖµÊ±£¬±£³Ö¼ì²âÖ¸¶¨Ö¡Êý£¬Èô¾ùµÍÓÚÖ¸¶¨Öµ£¬Ôò¹Ø±Õ¼ÖÆ£¬´ËʱµÃµ½Ò»¸öÒôƵÎļþ¡£
ÅäÖÃÎļþÈçÏ£º
<?xml version=encoding=?> <configuration> <appSettings> <!--¿ªÆô¼ÒôµÄÒôÁ¿ãÐÖµ--> <add key=value=/> <!--¹Ø±Õ¼ÒôµÄÒôÁ¿ãÐÖµ--> <add key=value=/> <!--µÍ·Ö±´³ÖÐø¼ì²âÖ¡Êý--> <add key=value=/> </appSettings> </configuration>
Ê×ÏÈ£¬±£³Ö²É¼¯Âó¿Ë·ç¡£´úÂëÈçÏ£º
public Form1() { InitializeComponent(); .microphoneCapturer.AudioCaptured += .microphoneCapturer.Start();//¿ªÊ¼²É¼¯ .audioFileMaker.Initialize(, this.microphoneCapturer.SampleRate, this.microphoneCapturer.ChannelCount); }
ÆäÖÐAudioCapturedʼþÒÔ20ºÁÃëµÄÖÜÆÚ´¥·¢£¬²ÎÊý¼´ÎªÂó¿Ë·ç²É¼¯µÃµ½µÄPCMÊý¾Ý¡£¶øÖÇÄܼÒôµÄÂß¼ÔòÖ÷ҪλÓÚAudioCapturedµÄʼþ´¦Àíº¯ÊýÖС£
void microphoneCapturer_AudioCaptured(byte[] data) { .frameCounter.Start(); .decibelDisplayer1.DisplayAudioData(data);.label_db.Text = .label_RecordSign.Text = : ; this.label_RecordSign.ForeColor = this.audioFileMaker.IsWorking ? Color.Blue : Color.Red; (])) { this.audioFileMaker.IsWorking = true; } (])) { (this.lowDBFrameCounter.Count == this.frameCounter.Count) { this.audioFileMaker.IsWorking = false; } this.frameCounter.IsWorking = false; this.lowDBFrameCounter.IsWorking = false; return; } (])) { this.frameCounter.IsWorking = true; this.lowDBFrameCounter.IsWorking = true; this.lowDBFrameCounter.Start(); } }
¡¤ºó¼ÇÔ´Â룺µã»÷ÏÂÔØ
Õâ¸ö³ÌÐòÆäʵ»¹¿ÉÒÔ½øÒ»²½ÍêÉÆ£¬²»½öÖÇÄܼÒô£¬»¹¿ÉÒÔÖÇÄܼÏñ£¬Ö»ÒªÄã²åÉÏÒ»¸öUSBÉãÏñÍ·£¬±ã¿É¸ù¾Ý¶¯¾²Â¼ÖƼà¿ØÊÓƵ¡£³ý´ËÖ®Í⣬ÔÙÓëͼÏñ·ÖÎö¼¼Êõ¼¯³É£¬¸ü¿ÉÒÔÍê³ÉÖÇÄÜ·ÀµÁµÈ¸ß¶Ë¹¦ÄÜ£¡
ÓÐÐËȤʵÏÖÖÇÄܼÏñµÄÅóÓÑ£¬¿ÉÒԲο¼£ºÊµÏÖÓïÒôÊÓƵ¼ÖÆ£¨demoÔ´Â룩
¡¡