16
Audio / Sounds stop playing after a while
« on: November 05, 2011, 07:20:11 pm »
Hi,
when I spawn lots of sounds, after a time they stop playing.
I load a sound from a file into a SoundBuffer once (in the constructor of the game).
Then everytime I need to play an instance of that sound I create a new sound instance (with the SoundBuffer from the beginning as parameter).
I immediately call Play on the instance without keeping a reference to it anywhere.
This works for a few seconds/minutes.
After a while no more sounds are being played.
The time until this happens varies, when i create more sound instances the time is shorter.
Am I doing anything wrong ?
when I spawn lots of sounds, after a time they stop playing.
I load a sound from a file into a SoundBuffer once (in the constructor of the game).
Then everytime I need to play an instance of that sound I create a new sound instance (with the SoundBuffer from the beginning as parameter).
I immediately call Play on the instance without keeping a reference to it anywhere.
This works for a few seconds/minutes.
After a while no more sounds are being played.
The time until this happens varies, when i create more sound instances the time is shorter.
Am I doing anything wrong ?