This function is used to free up the memory associated with the given audio queue. The queue index is the value returned when you created the queue using the function audio_create_play_queue(), and this function should be called when the queue is no longer required to prevent memory leaks. Freeing the queue will stop any sound that is be playing, and you cannot delete the buffer that a sound is being streamed from until the queue it is assigned to has been freed. This function will trigger an Audio Playback Asynchronous Event, and in this event a special ds_map will be created in the variable async_load with the following key/value pairs:
- "queue_id" - the queue that has finished playing data
- "buffer_id" - the buffer that is no longer being played from
- "queue_shutdown" - this is set to 0 during normal playback and 1 when the event is received because you have freed the queue with this function. When this is set to 1, you don't want to queue up any further data.IMPORTANT! This function is not available with the Trial Licence of the product.
|queueIndex||The index of the queue to free.|
var q_id = async_load[? "queue_id"]; if q_id ==
The above code would go in the asynchronous Audio Playback event and checks to see if the audio that has finished playing is from the "audio_queue" and if it is it frees the queue and the buffer associated with it.