title: Play audio to two different Audiodevices simultaneously with Naudio
body: <p>I'm trying to figure out how to play music to two different audiodevices at the same time.</p>
  
  <p>What I've done is to create a class that makes life easier for me when programming with Naudio, it has play mp3 &amp; wav's, pause, stop etc etc.</p>
  
  <p>What I'd love to have is the ability to chose what playback device the audiostream should be outputted to. Is there some way I can incorporate it like this:</p>
  
  <p>Play to: Realtek HD audio 2nd output and Speakers (if it was plugged in)</p>
  
  <p><img src="https://i.stack.imgur.com/kx9o9.png" alt="enter image description here"></p>
  
  <p>Here's the "Play" function I created:</p>
  
  <pre><code>public void Play(string Searchpath, int Time = 0)
      {
          DisposeWave();
          string FileExtension = System.IO.Path.GetExtension(Searchpath);
          if (FileExtension == (".mp3"))
          {
              NAudio.Wave.WaveStream pcmstream = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(Searchpath));
              stream = new NAudio.Wave.BlockAlignReductionStream(pcmstream);
          }
          else if (FileExtension == (".wav"))
          {
              NAudio.Wave.WaveStream pcmstream = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(Searchpath));
              stream = new NAudio.Wave.BlockAlignReductionStream(pcmstream);
          }
  
          output = new NAudio.Wave.DirectSoundOut();
          output.Init(stream);
          output.Play();
  
          Playbackstate = PlaybackState.Playing;
      }
  </code></pre>
  
  <p>Is there some page I can read up on this at?</p>
  
  <p>Thank you </p>