audio_set_listener_mask

Sets the default (global) listener bit mask.

Syntax:

audio_set_listener_mask(mask);


Argument Description
mask The bitmask data to set for the listeners


Returns: N/A


Description

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.




Example:

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.


Back: Audio Listeners
Next: audio_sound_set_listener_mask
© Copyright YoYo Games Ltd. 2015 All Rights Reserved