Ejemplo n.º 1
0
 private void disconnectLiveAudio()
 {
     if (connected)
     {
         audioSender?.Dispose();
         codec?.Dispose();
     }
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            // Client

            for (var i = 0; i < WaveIn.DeviceCount; i++)
            {
                Console.WriteLine(WaveIn.GetCapabilities(i).ProductName);
            }

            var ip     = new IPEndPoint(IPAddress.Parse("18.185.114.115"), 5555);
            var sender = new Sender(ip);

            var audioSender   = new NetworkAudioSender(0, sender);
            var audioReceiver = new NetworkAudioPlayer(sender);



            while (true)
            {
                var input = Console.ReadLine();
                if (input == "q")
                {
                    break;
                }
                else if (input != null)
                {
                    sender.Send(Encoding.UTF8.GetBytes(input));
                }
            }
            audioReceiver.Dispose();
            audioSender.Dispose();
            sender.Dispose();


            // Server

            /*
             * var server = new UDPServer(5555);
             *
             * while (true)
             * {
             *  if (Console.ReadLine() == "q") break;
             * }
             * server.Dispose();
             */
        }
Ejemplo n.º 3
0
 public void Stop()
 {
     IsWorking = false;
     NetworkAudioSender?.Dispose();
     NetworkAudioPlayer?.Dispose();
 }