private static void StartStreaming(Protos.Job job) { _screenCaptureServiceToken = new CancellationTokenSource(); _screenCaptureService = new ScreenCaptureService(NewBitmap); _screenCaptureService.StartCaptureAsync(_screenCaptureServiceToken.Token); Console.WriteLine("new job request: start streaming"); }
public async void StartCaptureAsync() { _audioLoopbackFile = await Windows.Storage.ApplicationData.Current.LocalCacheFolder.CreateFileAsync(CAPTURE_AUIDO_LOOPBACK_FILE, CreationCollisionOption.ReplaceExisting); _audioVoiceFile = await Windows.Storage.ApplicationData.Current.LocalCacheFolder.CreateFileAsync(CAPTURE_AUIDO_VOICE_FILE, CreationCollisionOption.ReplaceExisting); _voiceCapture.Mute(!IsCaptureMicrophoneAudio); _loopbackCapture.Mute(!IsCaptureBackgroundAudio); //For syncing the video frame and background audio frame. //Need start the scrren capture service at first,then start the loopback service, the voice service should be last one. //Start scrren capture service will take almost 1s. but start loopback service takes littile silliseconds. await _screenCapture.StartCaptureAsync(); await _loopbackCapture.Start(_audioLoopbackFile); await _voiceCapture.Start(_audioVoiceFile); }