public void GotAudioRtp(IPEndPoint remoteEndPoint, uint ssrc, uint seqnum, uint timestamp, int payloadID, bool marker, byte[] payload)
 {
     if (_waveProvider != null && _audioEncoder != null && _audioEncoder.IsSupported(_selectedSinkFormat))
     {
         var pcmSample = _audioEncoder.DecodeAudio(payload, _selectedSinkFormat, AudioPlaybackRate);
         _waveProvider?.AddSamples(pcmSample, 0, pcmSample.Length);
     }
 }
 public void GotAudioRtp(IPEndPoint remoteEndPoint, uint ssrc, uint seqnum, uint timestamp, int payloadID, bool marker, byte[] payload)
 {
     if (_waveProvider != null && _audioEncoder != null)
     {
         var    pcmSample = _audioEncoder.DecodeAudio(payload, _audioFormatManager.SelectedFormat);
         byte[] pcmBytes  = pcmSample.SelectMany(x => BitConverter.GetBytes(x)).ToArray();
         _waveProvider?.AddSamples(pcmBytes, 0, pcmBytes.Length);
     }
 }
Ejemplo n.º 3
0
        public void GotAudioRtp(IPEndPoint remoteEndPoint, uint ssrc, uint seqnum, uint timestamp, int payloadID, bool marker, byte[] payload)
        {
            var pcmSample = _audioEncoder.DecodeAudio(payload, _audioFormatManager.SelectedFormat);

            lock (_pendingRemoteSamples)
            {
                _pendingRemoteSamples.AddRange(pcmSample.SelectMany(x => new byte[] { (byte)(x >> 8), (byte)(x) }).ToArray());
            }

            _remoteSampleReady.Set();
        }
Ejemplo n.º 4
0
        public void GotAudioRtp(IPEndPoint remoteEndPoint, uint ssrc, uint seqnum, uint timestamp, int payloadID, bool marker, byte[] payload)
        {
            if (_audioEncoder != null && _audioEncoder.IsSupported(_selectedSinkFormat))
            {
                var pcmSample = _audioEncoder.DecodeAudio(payload, _selectedSinkFormat, AudioPlaybackRate);

                lock (_pendingRemoteSamples)
                {
                    _pendingRemoteSamples.AddRange(pcmSample);
                }

                _remoteSampleReady.Set();
            }
        }