private void btnStop_Click(object sender, EventArgs e) { if (source != null) { source.SignalToStop(); source.WaitForStop(); } if (output != null) { output.SignalToStop(); output.WaitForStop(); } updateButtons(); Array.Clear(current, 0, current.Length); updateWaveform(current, current.Length); }
/// <summary> /// Stops recording or playing a stream. /// </summary> /// private void btnStop_Click(object sender, EventArgs e) { // Stops both cases if (source != null) { // If we were recording source.SignalToStop(); source.WaitForStop(); } if (output != null) { // If we were playing output.SignalToStop(); output.WaitForStop(); } updateButtons(); // Also zero out the buffers and screen Array.Clear(current, 0, current.Length); updateWaveform(current, current.Length); }