Sign in to follow this  
DrGUI

5.1 surround from DirectSound?

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ....

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
if u insist on the SDK,u cant make it.because SDK has no multi-channel samples.
well,i have samples about multi-cahnnel with directsoud.the sample output 6channel to 6speakers.

6ch wav data(1file) --output---> 6 speaker
mono wav data x 6(6 file)--output---> 6 speaker

directsound can both.
and its different story which is u want to do.

if u want the samples,,,,buy my book.haha
ops..j/k.
but actually i cant give the code any1 else although i want to give it some1.its property of my books.
(Im japanese writer of books that how to use directX)

but i may give u hints.

Share this post


Link to post
Share on other sites
Hey,

Remigus found that the Play3DSound sample did give him 3D sound over his surround speakers, so I guess my code is fine. Now wait in eager anticipation for a startling relevation...

To be honest, I haven't actually got surround speakers.
However, I was trialing the SRS Audio Sandbox (which is fantastic!) and one of its features is if you haven't got surround sound, its drivers will expose 5.1 speakers, and will process the sound to go over stereo speakers / headphones etc.
It does indeed say 5.1 surround in the Control Panel's 'Sounds and Audio Devices' dialog, but the SRS control panel was showing audio input only through the L and R channels.
DirectSound's speaker configuration was also 5.1.

So I don't know whether it was working or not...I'll see if I can find some samples of multichannel sound, or a DVD perhaps...

In any case, I highly recommend SRS Audio Sandbox, it makes my music sound so good. I'm curious how it works over actual surround speakers http://www.srslabs.com/consumerhome500.asp

Thanks for your help ppl, and rates.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this