音频侦听器


When dealing with complex audio situations it can be useful to define where in the audio environment the listener should be situated. When working with the simple audio functions, it is not normally necessary for the listener to be changed in any way, however when using emitters to generate realistic audio within the 3D audio space, it is important that the listener be changed and moved correctly, or else the sound will be in the wrong position for the person playing your game.

GameMaker Studio 2 provides the following listener functions:

  1. audio_listener_position
  2. audio_listener_velocity
  3. audio_listener_orientation
  4. audio_listener_get_data
  5. audio_listener_set_position
  6. audio_listener_set_velocity
  7. audio_listener_set_orientation

Certain target platforms can permit more than one listener, with each one corresponding to a different output device, ie: your target platform could permit two listeners, one for the headphones and one for the monitor. Therefore GameMaker Studio 2 provides you with a number of extra functions with which you can find the available listeners as well as set them for sounds being played:

  1. audio_get_listener_count
  2. audio_get_listener_info
  3. audio_set_listener_mask
  4. audio_sound_set_listener_mask
  5. audio_emitter_set_listener_mask
  6. audio_get_listener_mask
  7. audio_sound_get_listener_mask
  8. audio_emitter_get_listener_mask