Game Development Community

Freeing audio buffers

by Phoenix Online Studios · in Technical Issues · 09/16/2007 (11:54 am) · 2 replies

I have a problem with sounds in Torque that needs to be dealt with: We use lots and lots of audio, and need to keep only the audio we need for the moment in memory. Deleting an AudioProfile when it's no longer needed is simple enough, but how to delete the audio buffer in memory? Is there an easy way of doing this? At the moment our memory usage just grows and grows the more audio we introduce...

It's possible to free the buffers with OpenALShutdownDriver() btw, but that's not the preferable way, as we don't want to fully disable audio just to unload audio we no longer use.

#1
10/07/2007 (11:55 am)
Ok, after some reading up and looking through the source code, I realized that with isStreaming=false in the AudioDescription (which it is by default), the buffered sounds stay in memory. Changing it to streaming did the trick!

This led to a new problem though, will bring that up in a new thread.
#2
10/07/2007 (11:59 am)
Interesting - thanks for the posts!