This function can be used to set the the bit-mask for a sound so that it will play only from those listeners specified. You can create a bit-mask by using the audio_get_listener_info() and then using the bitwise or ("|") to create a custom mask with those listeners that you require the sound to play from, and then apply this custom mask to the sound after you have played it. This mask will over-ride the default mask or that which you may have set using the function audio_set_listener_mask().

NOTE: This function can only be used on a sound after it has been set to play and requires the soundID as returned by the function used to play the sound.


audio_sound_set_listener_mask(soundID, mask);

参数 描述
soundID The unique ID of the sound to set the mask of
mask The bitmask data to set for the sound




var snd = audio_play_sound(snd_PlayerDead, 10, false);
audio_sound_set_listener_mask(snd, global.PlayerMask);

The above code plays a sound then sets the listener(s) to play from using the mask data stored in a global variable.