audio_emitter_free

Removes the given emitter from memory.

Syntax:

audio_emitter_free(emitter);


Argument Description
emitter The index of the emitter to free.


Returns: N/A


Description

With this function you can remove the given emitter from memory. This should always be done whenever the emitter is not going to be used further in the room or the game, ie: in the Destroy Event of the instance or in the Room End Event, otherwise you may end up with a memory leak that will slow down and eventually crash your game.


Example:

if lives = 0
   {
   audio_emitter_free(s_emit);
   room_goto(rm_Menu);
   }

The above code checks the value of the global variable "lives" and if it returns 0, it will destroy the emitter indexed in the variable "s_emit" and then go to the room indexed in the variable "rm_Menu".


Back: Audio Emitters
Next: audio_play_sound_on
© Copyright YoYo Games Ltd. 2018 All Rights Reserved