コード例 #1
0
        private void Btn_Down(object sender, MouseEventArgs e)
        {
            button1.Text      = "录音中...";
            button1.BackColor = Color.FromArgb(255, 120, 255);
            textBox1.Visible  = false;
            recorder          = new SoundRecord();
            try
            {
                recorder.InitCaptureDevice();
            }catch (NullReferenceException) { }
            try
            {
                recorder.mWavFormat = recorder.CreateWaveFormat();
            }
            catch (NullReferenceException) { }


            //
            // 录音设置
            //
            string wavfile;

            wavfile = "test.wav";
            //if (recorder == null)
            //{
            //    recorder = new SoundRecord();
            //}

            recorder.SetFileName(wavfile);
            recorder.RecStart();
        }