Пример #1
0
        private void OnCaptured(bool recover, IAudioPacket packet)
        {
            byte[] uncompressed;

            if (recover)
            {
                uncompressed = _codec.Restore(packet?.Payload ?? null);
            }
            else
            {
                uncompressed = _codec.Decode(packet.Payload);
            }

            _waveProvider.AddSamples(uncompressed, 0, uncompressed.Length);
        }
Пример #2
0
        private void OnProviderReceived(IPEndPoint remote, IAudioPacket packet)
        {
            if (remote == null || !_routes.Contains(remote))
            {
                return;
            }

            foreach (var route in _routes.ToArray())
            {
                if (remote.Equals(route))
                {
                    continue;
                }

                _provider.Send(route, packet);
            }
        }
Пример #3
0
 public void Handle(IAudioPacket packet)
 {
     _buffer.Enqueue(packet);
 }
Пример #4
0
 public void Send(IPEndPoint target, IAudioPacket packet)
 {
     _network.Send(target, packet.Pack());
 }
Пример #5
0
 public void Enqueue(IAudioPacket packet)
 {
     _jitter.Append(packet);
 }
Пример #6
0
 public void Send(IAudioPacket packet)
 {
     _transport.Send(packet.Pack());
 }