5.1 surround from DirectSound?

Started by
11 comments, last by DrGUI 17 years, 6 months ago
Hi I play 3D sounds using DirectSound, but how do you get it to output over 5 channels? I tried changing the number of channels when creating the primary buffer in the PlaySound3D sample but there didn't seem to be any difference. Thank you!
Advertisement
I think DirectSound only supports 2-channel output, but don't take my word for it. You could also try the slightly more modern XACT tool available in the DirectX August 2006 SDK.
Are you setting up a Listener3D around a primary buffer? I have some MDX sample code (I believe from Tom Miller's kickstart book) that shows how to set this up with DirectSound and it seems to work perfectly in 5.1 for my SB Audigy. In the SDK Sample browser you'll also find sample projects in both C# and C++ on how to set this up. Check the Play3DSound sample.

It also might be a driver issue, but if the sample works then you should be good to go.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Check out IDirectSound8::SetSpeakerConfig(). Just tell DirectSound you are using 5.1 speakers and your 3D sounds will adjust.
Anthony Rufrano
RealityFactory 2 Programmer
Hey

Yes, the sample Play3DSound was the one I was experimenting on. The sample works but it looks like it's only meant to be stereo.

The speaker configuration was already 5.1, and I tried creating the primary buffer with 5 and 6 channels, but it didn't seem to work.
For 5.1 should I have 5 or 6 channels?

Thanks for the replies.
Your sound must be mixed for 5.1 also. DirectSound just plays the sound you give it. It's mixing and mastering that produces 5.1 surround.
Anthony Rufrano
RealityFactory 2 Programmer
True, but I'm playing 3D sounds, which have to be mono anyway, so something's up with DirectSound's mixing.
Quote:Original post by DrGUI

For 5.1 should I have 5 or 6 channels?

Thanks for the replies.


5.1 = 6ch(6speaker)
6.1 = 7ch(7speaker)
7.1 = 8ch(8speaker)
....
bla bla

0.1 means super woofer speaker.

BTW directsound can output over 3chnnel individual since dsound8. 5ch 6ch ....
It's not DirectSound's mixing, it's that your sound is not mixed for 5.1. You are trying to play 5.1 surround with a 2 channel sound. It's not going to work. In your WAVEFORMATEX struct, what is the value of nChannels?
Anthony Rufrano
RealityFactory 2 Programmer
Thanks for that katsh.

paradoxnj, I see what you mean, however a 3D sound is mono yet it is usually mixed over 2 speakers for stereo (based on its position in relation to the the listener). Thus I would expect DirectSound to likewise mix the mono sound over 5.1 channels.

edit: though the number of channels in the DX sample (Play3DSound) was originally 2, I also tried it with 5 and 6 channels, but nothing seemed to change.

This topic is closed to new replies.

Advertisement