title: VB.net nAudio WaveIn stream to ftp
body: <p>okay so here is the deal..</p>
  
  <p>I am capturing the audio stream from microphone via naudio WaveIn method..
  Now this allows me to save my capture straight into a wav file continuously.</p>
  
  <p>Now i want this wav to be continuously uploaded on my ftp account.
  i.e the user is rec from mic.. his input is being stored into a file..and this file is being uploaded to my ftp.</p>
  
  <p>I am currently facing problems regarding file lock which certainly does not allow me to access the same file at the same time it is being written.</p>
  
  <p>I would be grateful to you if you can suggest me a method to upload my stream directly to my ftp account which does not involve this file issue</p>
  
  <p>This is my code for recording:</p>
  
  <p><code></p>
  
  <pre><code>  Dim recordingFormat As New WaveFormat(8000, 16, 1)
      writer = New WaveFileWriter("recorded.wav", recordingFormat)
  
      waveInStream = New WaveIn()
      waveInStream.DeviceNumber = 0
      waveInStream.WaveFormat = recordingFormat
      AddHandler waveInStream.DataAvailable, AddressOf waveInStream_DataAvailable
      waveInStream.StartRecording()
  </code></pre>
  
  <p></code></p>
  
  <p>And for continuously saving the stream into file:
  <code></p>
  
  <pre><code> writer.Write(e.Buffer, 0, e.BytesRecorded)
  </code></pre>
  
  <p></code></p>
  
  <p>I want this ^ to to be fed directly into the ftp buffer..</p>
  
  <p>Any help will be appreciated. TIA !</p>