private async void InternalAudioCheck()
        {
            try
            {
                loopbackAudioCapture = new LoopbackAudioCapture(MediaDevice.GetDefaultAudioRenderId(AudioDeviceRole.Default));
                await loopbackAudioCapture.Start();

                await loopbackAudioCapture.Stop();

                loopbackAudioCapture = null;
            }
            catch (Exception)
            {
                AudioToggleSwitch.IsOn = false;
            }
        }
Exemplo n.º 2
0
        private async void InitializeCapture(SizeInt32 size, LoopbackAudioCapture loopbackAudioCapture)
        {
            _item.Closed += OnClosed;
            _framePool    = Direct3D11CaptureFramePool.CreateFreeThreaded(
                _device,
                DirectXPixelFormat.B8G8R8A8UIntNormalized,
                1,
                size);
            _framePool.FrameArrived += OnFrameArrived;
            _session = _framePool.CreateCaptureSession(_item);

            if (loopbackAudioCapture != null)
            {
                await loopbackAudioCapture.Start();
            }

            _session.StartCapture();
        }