0

I'm new in audio programming and I have a task to do and I don't know how. If you could guide me in the right direction it would mean a lot to me.

I want to play differents mp3 files through all the channel of one sound device, for instance in a 7.1 card, through all the 8 mono channels. But I want to control them individually, I mean, been able to play, pause, stop and every other standard player options.

I' ve been testing MultiplexingWaveProvider and it worked just fine but I don't have the options to play, or stop the music, etc. Then I tried ASIO drivers for Naudio trying to address each channel individually but the last call I make to ASIO constructor overwrites the first one. How can I make this to work? Using Naudio or anyother free library?

Here is my code

AsioOut waveOutdevice1 = new AsioOut();
waveOutdevice1.ChannelOffset = -1;
waveOutdevice1.Init(input1);

AsioOut waveOutdevice2 = new AsioOut();
waveOutdevice2.ChannelOffset = 1;
waveOutdevice2.Init(input2);

waveOutdevice1.Play();
waveOutdevice2.Play();
JG in SD
  • 5,427
  • 3
  • 34
  • 46
Efrain
  • 1
  • 1

1 Answers1

0

You can't open multiple instances of AsioOut. You have to provide multi-channel input. The MultiplexingWaveProvider is what you need to use. I'm not sure what you mean that you don't have options to play and stop - you just use Play. If you want to play some channels but not others, then you'd implement another WaveProvider that can switch between reading from its source, and outputting silence. In other words, all channels are always playing, but some of them are playing silence.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194
  • Hi, Mark, thak you for your answer. Can you point me to an example where I can switch the WaveProvider, because I have tried without success, besides I have another question, if I do that and switch the WaveProvider, the listeners won't notice the gap in the others channels? How can do it? – Efrain Feb 28 '13 at 03:48