title: Using NAudio over TCP?
body: <p>I am looking at the demo projects for the NAUDIO library located here:</p>
  
  <p><a href="http://naudio.codeplex.com/" rel="nofollow">http://naudio.codeplex.com/</a></p>
  
  <p>They have an example for Network streaming that is currently running over UDP.  I am wondering what I would need to do to convert to run over TCP.  I need this to run over TCP to ensure that each packet arrives at the server:</p>
  
  <pre><code>private void Connect(IPEndPoint endPoint, int inputDeviceNumber, INetworkChatCodec codec)
          {
              waveIn = new WaveIn();
              waveIn.BufferMilliseconds = 50;
              waveIn.DeviceNumber = inputDeviceNumber;
              waveIn.WaveFormat = codec.RecordFormat;
              waveIn.DataAvailable += waveIn_DataAvailable;
              waveIn.StartRecording();
  
              udpSender = new UdpClient();
              udpListener = new UdpClient();
              //endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 7080);
              // To allow us to talk to ourselves for test purposes:
              // http://stackoverflow.com/questions/687868/sending-and-receiving-udp-packets-between-two-programs-on-the-same-computer
              //udpSender.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
              udpListener.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
              //udpSender.Client.Bind(endPoint);
              udpListener.Client.Bind(endPoint);
  
              udpSender.Connect(endPoint);
  
              waveOut = new WaveOut();
              waveProvider = new BufferedWaveProvider(codec.RecordFormat);
              waveOut.Init(waveProvider);
              waveOut.Play();
  
              connected = true;
              ListenerThreadState state = new ListenerThreadState() { Codec = codec, EndPoint = endPoint };
              ThreadPool.QueueUserWorkItem(this.ListenerThread, state);
          }
  </code></pre>
  
  <p>Any help is appreciated.  </p>