Some useage questions

Slicky

10-07-2011 06:39:44

I have some sound working so I'm off to a decent start.

Questions are:
(1) Static sounds - it looks like these are reusable as in you use them all the time - maybe at the same time. How do you create this type of sound?
(2) Cleanup - it a sound is attached to a scenenode does it automatically get cleaned up? What if it is a static sound and you want to use it again?

thanks

stickymango

13-07-2011 23:23:18

(1) Static sounds are generally short, frequently used sounds, the audio data will be shared if they are duplicated and are reference counted, so when all sounds referencing the audio data are destroyed, the audio data is also destroyed. They are created by default when using createSound(), if you set the 'stream' parameter to 'false' then the sound is considered static.
(2) I presume you mean if you destroy a scenenode does it destroy the sound object also, if so then no, its the users responsibility to destroy the sound themselves. The SoundManager automatically cleans up on shutdown, or you can manually destroy a sound using the destroySound() function.