I can play an infinite number short of non-looping sounds with no problem (because they clean up properly when the sound is over). However, I’m having trouble with looping sounds.
I use FSOUND_StopSound on a looping channel when I’m done with it. But after a few dozen of these bad things happen… sound fail to open. I have to assume I’m just using the wrong method of cleaning up sounds, so what SHOULD I be doing?
- PersonGuy asked 13 years ago
Yes, I’m using FSOUND_FREE to select the channel. It’s a looping sound of a door slidding open. But the door has a chance of shutting during the opening process.
So when the door starts to open I play the looped sound and remember the channel. When the door is closing I decrease it’s volume (so to sound doesn’t abruptly stop). When it’s volume reaches zero I use FSOUND_StopSound on the channel. I ensure that it never starts playing a new looped sound effect until I’ve called FSOUND_StopSound on the original channel.
Openning and closing the door repeatedly causes FSOUND_Sample_Load to eventually fail (for any sound effect).
I’ve also tried FSOUND_SetLoopMode and setting the channel to loop false in hopes that the sound would reach it’s end and clean up by itself… still no luck.
Please login first to submit.