Ejemplo n.º 1
0
 private void Start(UdpClient client = null)
 {
     _voice = new VoiceClient(new CodecInfo(VoiceCodec.Gsm610, App.Settings.Current.Voice.Quality),
         client, this.TransmitPredicate, this.ReceivePredicate);
     _voice.OutputVolume = App.Settings.Current.Voice.PlaybackVolume;
     _voice.OutputGain = App.Settings.Current.Voice.OutputGain;
     _voice.InputGain = App.Settings.Current.Voice.InputGain;
     if (client == null)
     {
         _publicEndPoint = new IPEndPoint(_session.ExternalAddress, _voice.LocalEndPoint.Port);
     }
     this.SubscribeEvents();
     _session.SendCtcp(_target, new CtcpCommand("VCHAT", "START",
         VoiceCodec.Gsm610.ToString(),
         App.Settings.Current.Voice.Quality.ToString(),
         _publicEndPoint.Address.ToString(),
         _publicEndPoint.Port.ToString(),
         _session.InternalAddress.ToString(),
         _voice.LocalEndPoint.Port.ToString()), false);
     if (_self != null)
     {
         SetIsVoiceChat(_self, true);
     }
     _voice.Open();
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     int sampleRate = 21760;
     var client = new VoiceClient(new CodecInfo(VoiceCodec.Gsm610, sampleRate), null,
         () =>
         {
             return true;
             return (GetKeyState(0x41) & 0x8000) > 0;
         });
     client.AddPeer(VoiceCodec.Gsm610, sampleRate, new IPEndPoint(Dns.GetHostEntry("spoon.failurefiles.com").AddressList[0], 57222));
     client.Open();
     Console.ReadLine();
     client.InputGain = 10;
     Console.ReadLine();
 }