This function will create a DS map and populate it with information for the given listener.
NOTE: You are responsible for the destruction of the returned DS Map using the appropriate function.
The DS map will contain the following keys:
The mask value can be used to set a sound or emitter to play from multiple listeners at once, simply using the bitwise or "|" to generate a mask for the sound (see the example code below), while the index is used to set the properties like position or velocity for a given listener using functions like audio_listener_set_position().
audio_get_listener_info(num);
| Argument | Description |
|---|---|
| num | The listener number to get the data for. |
ds_map
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;
ds_map_destroy(info);
}
audio_set_listener_mask(mask);
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.