Hi Ken,

It sounds to me like what you need here is XAudio2. XAudio2 was
designed to handle issues precisely like this situation without
wasting CPU power or memory in the process.

What you would do in XAudio2 to resolve this particular problem is
declare a source voice for the marching band, that is kind of like the
DirectSound SecondaryBuffer, and then you would pass the source voice
to one ore more submix voices. What makes XAudio2 superior to
DirectSound in this situation is you can independently control the
volumes for each channel for front left, rear left, front right,rear
right, and center speakers independently from each other all using the
same source  voice. So if you want to have a decent stereo sound while
the player is facing the marching band you can make the center, front
left, and front right volumes equal giving it a stereo type effect. As
the player moves into and passed the band you can slowly increase the
volume of the rear speakers while reducing the volume to the front and
center speakers.

So from a purely technical point of view I don't see any good reason
to go back to DirectX 7. XAudio2 which is the new API for 9, 10, and11
is far superior when it comes to 3d audio than DirectSound, and I
think would do what you want regarding something that sounds like a
stereo sound without actually using stereo sounds or wasting memory
etc needlessly.

Cheers!


On 4/29/13, Ken The PionEar <[email protected]> wrote:
> I had actually thought of switching to DX7 for that exact reason. The
> marching band in mono doesn't sound like much, even with a 3d effect added.
>
> It just sounds like a good radio playing the sound. There's no real depth.
> Then i thought about what i'd lose if I went to DX7. I wouldn't be able to
> add special effects, such as reverb, chorus, echo and the like. I'd also
> have to rewrite the whole direct input section.
> Since I didn't like either of those two ideas, I chose to simply split the
> stereo sound into two identical wave files, a left mono sound and a right
> one, and play them simultaneously. If you mess with Soundscape, you'll
> notice that the marching band is in stereo, just like with DX7--but it's
> really just two wave files playing.
> This is all well and good except for two things. First, the waste of CPU
> resources. This can be negated by checking the player's distance from the
> object. The sound of the right channel could be stopped until the player is
>
> a certain distance from the object. Then, you get the play position of the
> first file, play the second starting at that position, and move the sounds
> over to the minimum width and maximum width. I'm not sure how all this would
>
> sound, and right now it's purely theoretical. I do intend to give it a go
> eventually.
> The other, and more serious problem in our time, since we have a lot more
> CPU resources than ever, is the doppler problem. With doppler turned on, one
>
> of the stereo files is sure to get out of sync with the other, and all you
> have left is an echo effect. I suppose that in the main program loop I could
>
> always get the position of the left channel and reset the right channel
> accordingly, but I'm still hoping to find a good alternative.
> Ken
>

---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].

Reply via email to