private void RecordForThreeSecondsAndTerminateClick(object sender, RoutedEventArgs e) { _micRecorder = new MicrophoneRecorder(); _micRecorder.Start(TimeSpan.FromSeconds(3)); ThreadPool.QueueUserWorkItem( state => { Thread.Sleep(TimeSpan.FromSeconds(1)); _micRecorder.Stop(); SaveAndPlay(); }); }
private void RecordForThreeSecondsClick(object sender, RoutedEventArgs e) { _micRecorder = new MicrophoneRecorder(); _micRecorder.BufferReady += StartStopBufferReady; _micRecorder.Start(TimeSpan.FromSeconds(3)); }