Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Audio output to multiple Channels on multiple sound cards

1 view
Skip to first unread message

Strode@discussions.microsoft.com Chris Strode

unread,
Sep 14, 2005, 12:11:02 PM9/14/05
to
Hello all,

This is my first post here :)

The setup I have is Windows XP PC with 2x Terratec Phase 28 soundcards.
Each card gives 4 steroe pairs (8 channels per card ~ 16 channels total)
going to 8 pairs of speakers located around a lasertag arena.

I have written the lasertag game software in C# and would like to add sound
to the system triggered by certain events during the game.

I would like to do the following:

1) Play a single wav file (stereo) to all 8 pairs of channels,
2) Play individual wav file to each channel (or pair of channels)
3) Play MP3 files to all the channels.

I currently use directsound to play the wav files, but these only come out
of the 1st pair of channels of the first sound card.

I have also used MediaPlayer to play MP3 files but these again only come out
the first pair of speakers.

Do I need to use DSSPEAKER_DIRECTOUT so that all channels can be sent audio
info?

The other option would be to use ASIO I guess...


Any help would be appreciated

Thanks

Chris P. [MVP]

unread,
Sep 19, 2005, 11:54:55 AM9/19/05
to

Sorry for the slow response, I was away last week.

You're going to have to do a little more custom work here, but I'm sure
that's no surprise :)

What you need to do is open the audio device with the WAVEFORMATEXTENSIBLE
struct instead of the standard WAVEFORMATEX. In the case of DirectSound
use this struct on the call to SetFormat for the Secondary buffer. Specify
the number of channels as 8 and adjust all the other parameters as
appropriate. You still have to treat each card individually though, as
they show as separate devices in the system.

In order to get multi-channel MP3 playback I would consider a custom
DirectShow filter, although you could also achieve this in DirectSound by
decoding the MP3 stream through the ACM. But to me that's more complicated
than writing this simple DirectShow audio transform. The transform filter
would take a stereo input and convert it to a n channel output (using
WAVEFORMATEXTENSIBLE in the media type).

ASIO, depending on the sound card driver may merge the 2 identical devices
into 1 virtual 16-channel device. I've seen some drivers that do, and
others that don't.

-Chris

0 new messages