/// <summary> /// Used to limit video duration to 15 seconds /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void dt_Tick(object sender, EventArgs e) { // Stop recording. if (_currentAppState == ButtonState.Recording && _videoCaptureDevice != null) { await _videoCaptureDevice.StopRecordingAsync(); _stream.AsStream().Dispose(); _dt.Stop(); // Set the button states and the message. UpdateUi(ButtonState.NoChange, "Preparing viewfinder..."); StartVideoPreview(); } }
private async Task StopRecordingAsync() { await mic.StopRecordingAsync(); mic.Dispose(); await sst.AsStream().FlushAsync(); sst.Dispose(); }
// 停止录像 private async void btnStop_Click(object sender, RoutedEventArgs e) { // 停止录像 await _captureDevice.StopRecordingAsync(); _stream.Dispose(); btnCapture.IsEnabled = true; btnStop.IsEnabled = false; }
private async Task StopRecordingAsync() { await mic.StopRecordingAsync(); mic.Dispose(); await sst.AsStream().FlushAsync(); SaveAudioClipToLocalStorage(); sst.Dispose(); }
public async void StopRecord() { await _mic.StopRecordingAsync(); _randomAccessStream.CloneStream(); }