This project has moved and is read-only. For the latest updates, please go here.

Multiple Sound Cards & Output Support

Nov 28, 2010 at 5:46 PM


Could you please give me some points to let find how I can achieve the following:

I have 3 sound cards, with 2 outputs each.

I will have multiple "players", that will read a playlist of MP3 files with standard cross fading.

I want to be able to assign each player to:

1. One output on a give soundcard in stereo (for example output 2 or soundcard 1)


2. Multiple outputs of given soundcard/outputs in stereo (for example output 1 & 2 of soundcard 1 and output 2 of soundcard 3)


3. Play mono (from a stereo sound file) on right (or left) of a given output of a given sound card.

Thanks a lot in advance.

Nov 29, 2010 at 9:41 AM

you would need to create your own waveproviders that turn stereo into mono, or take the right channel of input and pipe it to left channel of output (say). These are not too hard to write so long as you understand that left and right samples are interleaved in stereo audio.

Your bigger challenge (depending on how exactly you intend to use this) that there is no easy way to synchronize all the soundcards accurately. It is generally easier to work with a single multi-output soundcard.


Nov 29, 2010 at 12:26 PM

Hi Mark,

Thanks for your answer. And thanks for that great project!

Having the soundcards synchronized is not necessary. Regarding multi-output. I wasn't able to determine how I can select an input in the samples. Could you please give me some pointers?

Thanks a lot!

Nov 29, 2010 at 1:58 PM

you need to create classes that derive from WaveStream (or IWaveProvider). In the read method, to return only the left channel, you read two bytes from your source, then skip two (assuming your source is 16 bit). Then send those two bytes out twice (to copy to both channels).

If you are asking how to open different soundcards, look at the DeviceNumber property of WaveOut


Nov 29, 2010 at 3:03 PM

Thanks Mark,

Sorry to abuse of your time, but could you tell me how I can select a soundcard and the output ? In the samples, it looks like they are targetting the default soundcard and default output.


Nov 29, 2010 at 5:03 PM

create a new WaveOut object, set its DeviceNumber property (0 is default soundcard) then call init