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

How do I play a stereo stream across 4 channels?

Mar 1, 2013 at 4:09 AM
I am trying to play a stereo stream across 4 channels (Right channel to RF RR and Left channel to LF LR), but only if the current hardware supports it (sound card with at least 4 outputs).

How do I accomplish this?
Mar 1, 2013 at 7:52 AM
Exactly for your problem naudio has a class called MultiplexingWaveProvider.

Just use the ConnectInputToOutput to connect your right channel to rf and rr and so on. If you call Read or playback the multiplexingwaveprovider you've created, your channels will be mapped automatically.
Mar 1, 2013 at 1:18 PM
How do I verify the current hardware supports 4 channels before I use the MultiplexingWaveProvider?

Will it error out if I set up 4 channels and the hardware only supports 2?
Mar 1, 2013 at 2:08 PM
It depends on the soundout you are using. But of course it will cause an error.
For example if you use directsoundout you can findout whether 4 channels are supported by calling GetCaps. Or if you use WaveOut you can call WaveOut.GetCapabilities(int) and check the channels. But DirectSoundOut and WaveOut won't support that anyway. I guess WasAPI can do this but you still will have to check wether it supports it or not.