private void buttonStartRec_Click(object sender, System.EventArgs e) { this.buttonStartRec.Enabled = false; this.labelRec.Text = "Recording..."; // start recording paused _myRecProc = new RECORDPROC(MyRecoring); _recHandle = Bass.BASS_RecordStart(44100, 2, BASSFlag.BASS_RECORD_PAUSE, _myRecProc, new IntPtr(_encHandle)); // needs 'lame.exe' ! // the recorded data will be written to a file called rectest.mp3 // create the encoder...192kbps, stereo // MP3 encoder setup lame = new EncoderLAME(_recHandle); lame.InputFile = null; //STDIN lame.OutputFile = "rectest.mp3"; lame.LAME_Bitrate = (int)EncoderLAME.BITRATE.kbps_192; lame.LAME_Mode = EncoderLAME.LAMEMode.Default; lame.LAME_TargetSampleRate = (int)EncoderLAME.SAMPLERATE.Hz_44100; lame.LAME_Quality = EncoderLAME.LAMEQuality.Quality; monBuffer.Clear(); checkBoxMonitor.Checked = false; // create a live recording WaveForm WF = new WaveForm(); WF.FrameResolution = 0.01f; // 10ms are nice // start a live recording waveform with 5sec. init size and 2sec. next size WF.RenderStartRecording(_recHandle, 5f, 2f); // really start recording lame.Start(null, IntPtr.Zero, false); Bass.BASS_ChannelPlay(_recHandle, false); }
public void Reset() { if (basbuffer != null) { basbuffer.Clear(); } }
public void ClearBuffer() { if (_streamBuffer != null) { _streamBuffer.Clear(); } }
public override void Stop() { // In real world usage you must remember to free the BASS stream if not reusing it! basbuffer.Clear(); }