title: Writing multiple wav files from NAudio asioOut
body: <p>I'm trying to record 3-4 streams of audio and write them to separate wav files.  I'm using NAudio's asioOut to capture the audio.  At first I was just writing a 3 or 4 channel wav file.  So I searched questions here and thought I founded an <a href="https://stackoverflow.com/questions/12075062/saving-each-wav-channel-as-a-mono-channel-wav-file-using-naudio">answer</a>, but I still can't figure it out.  Now I can write the separate wav files but they have multiple channels in each file.</p>
  
  <p>channel_1.wav --------> has channel 1 and 2</p>
  
  <p>channel_2.wav --------> has channel 1 and 3</p>
  
  <p>channel_3.wav --------> has channel 2 and 3</p>
  
  <p>I think there is a problem when I try to parse the <em>GetAsInterleavedSamples()</em>.</p>
  
  <p>This is my asioOut_AudioAvailable()</p>
  
  <pre><code>    void asioOut_AudioAvailable(object sender, AsioAudioAvailableEventArgs e)
      {     
  
          float[] samples = new float[2 * 44100 * GetUserSpecifiedChannelCount()];
  
          samples = e.GetAsInterleavedSamples();
  
          int offset = 0;
          while (offset &lt; samples.Length)
          {
              for (int n = 0; n &lt; this.writers.Length; n++)
              {
                  this.writers[n].WriteSamples(samples, offset, 2);
                  offset += 2;
              }
          }
  
      }
  </code></pre>
  
  <p>I'm new at this so I'm just learning as a go, any help would be greatly appreciated.  </p>
  
  <p>Thanks.  </p>