public override void windowsClosed() { if (newWaveIn != null) { newWaveIn.StopRecording(); stopListening(); } }
private void buttonStop_Click(object sender, EventArgs e) { timer.Enabled = false; if (!stopped) { waveIn.StopRecording(); } }
public void Dispose() { if (_waveIn != null) { _waveIn.StopRecording(); _waveIn.DataAvailable -= OnDataAvailable; _waveIn.Dispose(); } _writer?.Close(); }
private void button1_Click(object sender, EventArgs e) { if (_recording) { waveIn.StopRecording(); } else { _recording = true; waveIn.StartRecording(); SendGameEvent(); } }
/// <summary> /// If a file is being recorded, stop recording and tidy up the stream. /// </summary> private void StopRecording() { recordButton.Text = recordText; if (dataEvent) { waveIn.DataAvailable -= OnDataAvailable; dataEvent = false; } if (waveIn != null) { waveIn.StopRecording(); } FinalizeWaveFile(writer); }
public void Dispose() { if (wave_in != null) { wave_in.StopRecording(); wave_in.Dispose(); wave_in = null; } if (writer != null) { writer.Close(); writer = null; } }
public void Dispose() { if (_waveIn != null) { _waveIn.StopRecording(); _waveIn.Dispose(); _waveIn = null; } if (_writer != null) { _writer.Close(); _writer = null; } }
private void StopReading() { input?.StopRecording(); Start.Enabled = true; Stop.Enabled = false; }
private void ExecuteStop() { //SpectralAnaliser0.Stop(); //SpectralAnaliser1.Stop(); wave_in.StopRecording(); wave_in.Dispose(); }
private void InitializeWaveIn() { if (_waveIn != null) { _waveIn.StopRecording(); _waveIn.DataAvailable -= OnDataAvailable; _waveIn.RecordingStopped -= OnRecordingStopped; _waveIn.Dispose(); } _waveIn = new WaveInEvent { WaveFormat = new WaveFormat(SAMPLING_RATE, SAMPLING_BITS, SAMPLING_CHANNELS) }; //_waveIn = new WasapiCapture((MMDevice)ComboBoxRecordingDevice.SelectedItem); _waveIn.DataAvailable += OnDataAvailable; _waveIn.RecordingStopped += OnRecordingStopped; }
private void EndStreaming() { streaming = false; if (gzipCompressor != null) { gzipCompressor.Close(); gzipCompressor.Dispose(); } if (waveIn != null) { waveIn.StopRecording(); waveIn.Dispose(); waveIn = null; } if (keyboardHook != null) { keyboardHook.Dispose(); keyboardHook = null; } Disconnect(); UpdateTrayMenuAndIcon(); }
//private void DisposeAudioWriters() { // mutAudioFileProcess.WaitOne(); // audioFileWriters = null; // mutAudioFileProcess.ReleaseMutex(); //} public void Dispose() { isDisposing = true; camera.StopCameras(); camera.Dispose(); mutAudioFileProcess.Dispose(); mutVideoRecord.Dispose(); try { threadVideoDisplay.Join(); threadVideoDisplay = null; threadVideoFrameExtract.Join(); threadVideoFrameExtract = null; threadAudioDisplay.Join(); threadAudioDisplay = null; AudioDataAvailable = null; VideoDataAvailable = null; // audio complete audioCaptureDevice.DataAvailable -= OnAudioDataAvailable; audioCaptureDevice.StopRecording(); audioCaptureDevice.Dispose(); } catch (Exception e) { Debug.WriteLine($"An exception occured when the {field.ToString()}-view Kinect is being closed!"); Debug.WriteLine(e.ToString()); } }
public void Stop() { _waveIn.StopRecording(); _waveIn.Dispose(); _waveIn = null; //_buffer = null; }
public void close() { if (!_online) { return; } // Close Device if (openDev.audioDeviceType == AudioDeviceType.Windows) { try { waveIn.StopRecording(); waveIn.Dispose(); } catch (Exception E) { } waveIn = null; openDev = null; } else // WASAPI Device { try { WASAPIwaveIn.StopRecording(); WASAPIwaveIn.Dispose(); } catch (Exception E) { } WASAPIwaveIn = null; openDev = null; } _online = false; }
private void StopRecording() { if (recorder != null) { recorder.StopRecording(); } }
public void Dispose(ref string tex) { lock (mixOut) { if (startReading != null) { startReading.Dispose(); startReading = null; } } Logger.mix.a("dispose recCap"); tex = "recCap"; if (recCap != null) { recCap.StopRecording(); } Logger.mix.a("dispose micCap"); tex = "micCap"; if (micCap != null) { micCap.StopRecording(); } Logger.mix.a("dispose mixOut"); tex = "mixOut"; if (mixOut != null) { mixOut.Dispose(); } Logger.mix.a("dispose recRe"); tex = "recRe"; if (recRe != null) { recRe.Dispose(); } Logger.mix.a("dispose micRe"); tex = "micRe"; if (micRe != null) { micRe.Dispose(); } Logger.mix.a("disposed"); }
/// <summary>断开与音频输入设备的连接</summary> public void Stop() { if (this.IsRunning) { if (waveIn == null) { return; } try { waveIn.StopRecording(); waveIn.Dispose(); } catch (Exception ex) { Console.WriteLine(" -> audio.stop.error"); Console.WriteLine(ex.ToString()); } finally { waveIn = null; } } this.IsRunning = false; }
public void CloseRecording() { if (captureDevice != null) { captureDevice.StopRecording(); } if (writer != null) { // this will fix up the data lengths in the recorded memory stream writer.Close(); writer = null; recordedStream.Position = 0; RaiseCaptureStopped(); } }
private void StopRecording() { if (waveIn != null) { waveIn.StopRecording(); } FinalizeWaveFile(writer); }
public void Recordstop() { //Debug.WriteLine("StopRecording"); if (waveIn != null) { waveIn.StopRecording(); } }
/// <summary> /// 停止录音 /// </summary> public void StopRecording() { if (m_WaveIn != null) { m_WaveIn?.StopRecording(); } Cleanup(); }
public void StopRecording() { if (_waveIn == null) { return; } _waveIn.StopRecording(); }
public void StopRecording() { waveIn.StopRecording(); waveIn.Dispose(); waveFileWriter.Close(); OnRecordingStopped(); ConvertWavToMp3Thread(); }
// 停止录音的外部接口 public void StopRecording() { waveIn.StopRecording(); waveIn.Dispose(); waveIn = null; writer.Dispose(); writer = null; }
void StopRecording() { Debug.WriteLine("StopRecording"); if (waveIn != null) { waveIn.StopRecording(); } }
public void Stop() { if (GetStatus == true) { waveIn.StopRecording(); GetStatus = false; } }
public void StopAudioAlgorithm() { waveIn.StopRecording(); _laserAnimationStatus.AnimationSpeed = AnimationSpeed.Off; _laserAnimationStatus.AnimationCanceled = true; _timer.Enabled = false; _timer.Stop(); }
public void Stop() { if (!_isrecording) { return; } _isrecording = false; _waveIn.StopRecording(); }
void StopRecording() { Debug.WriteLine("StopRecording"); //captureDevice?.StopRecording(); if (captureDevice != null) { captureDevice.StopRecording(); } }
protected override void OnHandleDestroyed(EventArgs e) { player?.Stop(); player?.Dispose(); recorder?.StopRecording(); recorder?.Dispose(); base.OnHandleDestroyed(e); }
public MemoryStream GetWavSample(int seconds, string filepath) { var stream = new MemoryStream(); _fileName = filepath; _waveIn = new WasapiLoopbackCapture(); _writer = new WaveFileWriter(stream, _waveIn.WaveFormat); _waveIn.DataAvailable += OnDataAvailable; _waveIn.RecordingStopped += OnRecordingStopped; _waveIn.StartRecording(); _isRecording = true; System.Threading.Thread.Sleep(seconds * 1000); _waveIn.StopRecording(); if (filepath != "") using (var file = new FileStream(filepath, FileMode.Create, FileAccess.Write)) stream.WriteTo(file); return stream; }