|mask||The bitmask data to set for the listeners|
When using multiple listeners on a system, you can set the
bit-mask for a sound and have it heard from the flagged listener
only. However, you can also set the global mask using this
function and all sounds played normally will be heard from the
listeners flagged by this mask, without the need to set the mask
for each sound individually.
var num = audio_get_listener_count();
var mask = 0; for(var i = 0; i < num; ++i;)
var info = audio_get_listener_info(i);
var m = audio_listener_get_data(info[? "mask"]);
mask = mask | m;
The above code checks the number of listeners available then loops through them gets their mask bits, which are then combined to create a single bit mask which is applied to the global listener.