Managed DirectSound - Multiple Instances Of The Same Sound
Hey all,
What's the most efficient way to play the same wav file at the same time? Is manually reading in wav files into streams and keeping track of those, then creating new SecondaryBuffers (if none non-playing ones available) the way to go?
I tried just creating an abundant amount of SecondaryBuffers using a filename, but I believe this to be loading the file every time because my FPS cut from 1K to 100. ;)
If anyone has any insights before I jump into manual wav loading, I'd love to hear 'em.
"Non-managed" DirectSound has the function: IDirectSound8::DuplicateSoundBuffer(). I would expect managed DirectSound to have the same function somewhere. Don't know the specifics on how it works, but it doesn't duplicate the sound memory itself, just the interface to it so you can play multiple instances of the same sound by duplicating the buffer for each additional instance.
As for wav loading, again for "Non-managed" DirectX the nice people at Microsoft wrote a "CWave" class that wrapped up wav loading. Perhaps there is also a "CWave" class for managed DirectX? Dig around the samples folder.
As for wav loading, again for "Non-managed" DirectX the nice people at Microsoft wrote a "CWave" class that wrapped up wav loading. Perhaps there is also a "CWave" class for managed DirectX? Dig around the samples folder.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement