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

MultiplexingWaveProvider Help

Jan 2, 2014 at 4:06 AM
I'm following the example in Mark's blog post to try to send 2 mp3 files each to their own device output (a 2 channel sound card). It seems this should work but does not.
var input1 = new Mp3FileReader(@"path to mp3 file #1");
var input2 = new Mp3FileReader(@"path to mp3 file #1);

MultiplexingWaveProvider waveProvider = new MultiplexingWaveProvider(new IWaveProvider[] { input1, input2 }, 4);

waveProvider.ConnectInputToOutput(2, 0);
waveProvider.ConnectInputToOutput(3, 1);
waveProvider.ConnectInputToOutput(1, 2);
waveProvider.ConnectInputToOutput(1, 3);

WaveOut wave = new WaveOut();
I get an exception thrown (System.Windows.Markup.XamlParseException) on wave.init(waveProvider).

I suspect I'm missing something rather obvious here?
Jan 3, 2014 at 6:14 PM
Your soundcard would need to support 4 channel audio for this to work. It may be that the drivers do not support this (or present your outputs to windows as separate stereo pairs).