Example #1
0
        void AudioProvider_DataAvailable(object Sender, DataAvailableEventArgs E)
        {
            try
            {
                lock (_syncLock)
                {
                    if (_disposed)
                    {
                        return;
                    }
                }

                _videoWriter.WriteAudio(E.Buffer, E.Length);
            }
            catch (Exception e)
            {
                if (_imageProvider == null)
                {
                    lock (_syncLock)
                    {
                        if (!_disposed)
                        {
                            ErrorOccurred?.Invoke(e);

                            Dispose(true, true);
                        }
                    }
                }
            }
        }
Example #2
0
 void AudioProvider_DataAvailable(object sender, DataAvailableEventArgs e)
 {
     try
     {
         _videoWriter.WriteAudio(e.Buffer, e.Length);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
Example #3
0
        void AudioDataAvailable(object sender, DataAvailableEventArgs e)
        {
            try
            {
                if (_audioProvider.IsSynchronizable)
                {
                    if (WaitHandle.WaitAny(new WaitHandle[] { _videoFrameWritten, _stopCapturing }) != 0)
                    {
                        return;
                    }

                    _videoEncoder.WriteAudio(e.Buffer, e.Length);

                    _audioBlockWritten.Set();
                }
                else
                {
                    _videoEncoder.WriteAudio(e.Buffer, e.Length);
                }
            }
            catch { }
        }
Example #4
0
 void AudioProvider_DataAvailable(object sender, DataAvailableEventArgs e)
 {
     _videoWriter.WriteAudio(e.Buffer, e.Length);
 }
Example #5
0
 void AudioProvider_DataAvailable(object sender, DataAvailableEventArgs e)
 {
     try { _frames.Add(e); }
     catch { }
 }
Example #6
0
 void AudioProvider_DataAvailable(object Sender, DataAvailableEventArgs E)
 {
     _videoWriter.WriteAudio(E.Buffer, E.Length);
 }