Game Development Community

Stopping audio at the end of loop sequence

by Martin Soderberg · in Torque Game Engine · 03/18/2007 (7:25 am) · 0 replies

Posted this in the Audio forum, but there hasn't been a single post in that forum for days now. Sorry for the crossposting.

I have a sound that is activated when I push a mouse button. It should then stop when I release the same button. Now, that is simple to do. However, I want it to complete the current iteration of the loop sequence before stopping, to allow the whole sound to play, even if you release the button at the start of the sound.

Is this possible to do in a simple way, without digging deeper in the C++ code than I have? I have made simple functions to change the looping-state in the C++ code, but I don't know how to determine that the sound has played the whole way through, and simply changing AL_LOOPING to false doesn't seem to do it.