Example #1
0
		public VoicePeer(VoiceCodec codec, int quality, VoicePacketPool pool)
		{
			_codec = new CodecInfo(codec, quality);
			_buffer = new JitterBuffer(_codec);
			_pool = pool;
			this.InitAudio();
		}
Example #2
0
 public VoicePeer(VoiceCodec codec, int quality, VoicePacketPool pool)
 {
     _codec  = new CodecInfo(codec, quality);
     _buffer = new JitterBuffer(_codec);
     _pool   = pool;
     this.InitAudio();
 }
Example #3
0
 /// <summary>
 /// Construct a new voice session.
 /// </summary>
 /// <param name="codec">The transmit codec.</param>
 /// <param name="quality">The transmit quality (usually the sample rate).</param>
 /// <param name="client">An optional already-bound UDP client to use. If this is null, then a new client will be constructed.</param>
 /// <param name="transmitCallback">An optional callback to determine whether to transmit each packet. An application may
 /// use logic such as PTT (push-to-talk) or an automatic peak level-based approach. By default, all packets are transmitted.</param>
 public VoiceClient(CodecInfo codec, UdpClient client   = null,
                    TransmitPredicate transmitPredicate = null, ReceivePredicate receivePredicate = null)
     : base((byte)codec.PayloadType, codec.EncodedBufferSize, new IPEndPoint(new IPAddress(DummyIPAddress), DummyPort), client)
 {
     _peers            = new Dictionary <IPEndPoint, VoicePeer>();
     _pool             = new VoicePacketPool();
     _receivePredicate = receivePredicate;
     _voiceIn          = new VoiceIn(codec, this, transmitPredicate);
 }
Example #4
0
		/// <summary>
		/// Construct a new voice session.
		/// </summary>
		/// <param name="codec">The transmit codec.</param>
		/// <param name="quality">The transmit quality (usually the sample rate).</param>
		/// <param name="client">An optional already-bound UDP client to use. If this is null, then a new client will be constructed.</param>
		/// <param name="transmitCallback">An optional callback to determine whether to transmit each packet. An application may
		/// use logic such as PTT (push-to-talk) or an automatic peak level-based approach. By default, all packets are transmitted.</param>
		public VoiceClient(CodecInfo codec, UdpClient client = null,
			TransmitPredicate transmitPredicate = null, ReceivePredicate receivePredicate = null)
			: base((byte)codec.PayloadType, codec.EncodedBufferSize, new IPEndPoint(new IPAddress(DummyIPAddress), DummyPort), client)
		{
			_peers = new Dictionary<IPEndPoint, VoicePeer>();
			_pool = new VoicePacketPool();
			_receivePredicate = receivePredicate;
			_voiceIn = new VoiceIn(codec, this, transmitPredicate);
		}
Example #5
0
		internal VoicePacket(VoicePacketPool pool)
		{
			_pool = pool;
		}
Example #6
0
 internal VoicePacket(VoicePacketPool pool)
 {
     _pool = pool;
 }