14 Mei 2012 4:00
What is the best way to overlap sound effects using XAudio2?
Right now, I'm creating multiple SourceVoices and rotating through them submitting the same wave file's SourceBuffers and calling play. When one finishes playing, I put it back in the pool to be reused.
That definitely works but is that best practice or the only way?
15 Mei 2012 3:38Just call IXAudio2SourceVoice::Start when the audio is finished.
15 Mei 2012 13:42That queues the next voice but does not overlap them.
15 Mei 2012 19:44
If you want multiple sounds playing at once, you have multiple XAudio2SourceVoice instances. You can have them share the same audio data or not as you choose as the application maintains full ownership of the audio sample data memory at all times.
You should take some time to read through the entire XAUDIO2 programmer's guide to make sure you have all the concepts down. You may also want to check out some older Gamefest audio presentations as well--they are mostly about the legacy DirectX SDK versions of XAUDIO2, but the design is essentially the same.
- Ditandai sebagai Jawaban oleh Larry Olson 16 Mei 2012 0:14