This project has moved. For the latest updates, please go here.

How to play multiple wave files simultaniously using ASIO

May 25, 2012 at 7:18 AM


   I am using the NAudio way for playing the single wave file, I am trying to extend the same way to play two wave files to different channels simultanioulsy . Currently I am using  driver.createbuffer function to create the buffers. Second call of this funtion for creaing the second buffer is failing.

Please let me know if it is possible to play multiple wave files using ASIO.


Thanks in advance



May 25, 2012 at 9:02 AM

you can't have multiple instances of AsioOut. Instead you would use the multiplexing wave provider I describe here:

May 25, 2012 at 12:17 PM
Edited May 25, 2012 at 12:18 PM


  If you have the class for multiplexing wave provider please share the same. Using this can I play to specific files to specific channels. 




Thanks in advance

May 25, 2012 at 12:29 PM

they are in the latest NAudio source code.

May 25, 2012 at 1:19 PM
Edited May 25, 2012 at 2:18 PM

var waveProvider = new MultiplexingWaveProvider(new IWaveProvider[] { soundMangerObj.reader, soundMangerObj.reader1 }, 4);


 AsioOut dfd = new AsioOut();
 string ffd = dfd.DriverName;


My PC is connected with the device which has 10 IN and 10 OUT channels. I am getting exception when it try to call conncetinputtooutput, Please help

 My requirement is suppose my speakers are connected to Speaker-1 to Output Channel-5 and Speaker -2 to Output Channel-8 how should i configure the channels to play the files only to this specific channels , all the other channels should not hear anything.

Thanks in advance

May 25, 2012 at 3:06 PM

these numbers should be zero based which is probably causing your exception

The multiplexing wave provider doesn't currently have the ability to disconnect an input. You could add that, or make a silence playing waveprovider (very easy to do - just implement IWaveProvider and zero out the buffer), which you connect to the inputs you want silent.

My soundcard only has two outputs so I've never been able to test ASIO with higher channel counts. hope it works for you.

May 26, 2012 at 4:53 AM
Edited May 26, 2012 at 8:13 AM

Hi ,

  I tried this but I am not getting this please provide me with some samples which will be really helpful.

 I need to play a two mono file to two input channels say ch-1 and ch-7. Is there any sample that you can provide me or the read() function which will solve my purpose

Thanks in advance