audio_debug


描述

This function can be used to display debug information about the audio system, with true switching it on and false to switch it off. When you are debugging audio in this way, the overlay will show the following information:

  1. Handle - The OpenAL source handle (unique for every sound played)
  2. Data Handle - The OpenAL buffer handle (shows the same value for multiple sounds with the same source handle)
  3. Processed Buffers - how many buffers have been played
  4. Queued Buffers - how many buffers have been queued (and are still waiting to play)
  5. Gain - The gain value for the audio (0 - 65536)
  6. Play Offset - the sample position (current play position) into the current buffer
  7. Queued Buffers Bars - a small box diagram of the processed/queued buffers with the play offset (current position) drawn as a blue line

For synchronised groups of audio, you also have the function audio_sync_group_debug().

NOTE: This function does not work on the HTML5 target platform.


语法:

audio_debug(enable);


参数 描述
enable Enable (set to true) or disable (false) audio debugging.


返回:

N/A(无返回值)


例如:

if (debug_mode)
   {
   audio_debug(true);
   }
else
   {
   audio_debug(false);
   }

The above code will switch on or off the audio debug overlay depending on whether the game is running in debug mode or not.