<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<script type="text/javascript" language="JavaScript">
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
</script>
<style type="text/css">
< !-- div.WebHelpPopupMenu {
position: absolute;
left: 0px;
top: 0px;
z-index: 4;
visibility: hidden;
}
p.WebHelpNavBar {
text-align: right;
}
-->
</style>
<script type="text/javascript">
gRootRelPath = "../../../..";
gCommonRootRelPath = "../../../..";
gTopicId = "9.2.2.5.0_31";
<script type="text/javascript" src="../../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../../whxdata/projectsettings.js"></script>
<link rel="stylesheet" type="text/css" href="../../../../template/styles/topic.min.css"/>
<link rel="stylesheet" type="text/css" href="../../../../template/Charcoal_Grey/topicheader.css"/>
<meta name="topic-status" content="Draft"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>audio_debug</title>
<meta name="generator" content="Adobe RoboHelp 2019"/>
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css"/>
<meta name="rh-authors" content="Mark Alexander"/>
<meta name="topic-comment" content="Page explaining the function audio_debug"/>
<meta name="rh-index-keywords" content="audio_debug"/>
<meta name="search-keywords" content="audio_debug"/>
</head>
<body>
<div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
<div class="logo">
</div>
<div class="nav">
<div class="title" title="audio_debug">
<span>audio_debug</span>
</div>
<div class="gotohome" title="Click here to see this page in full context">
<span>Click here to see this page in full context</span>
</div>
</div>
</div>
<div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>
<h1>audio_debug</h1>
<p>This function can be used to display debug information about the audio system, with <tt>true</tt> switching it on and <tt>false</tt> to switch it off. When you are debugging audio in this way, the overlay will show the following information:</p>
<p><img alt="Audio Debug Overview" class="center" src="../../../../assets/Images/Scripting_Reference/GML/Reference/Audio/Audio_Debug.png"/></p>
<ul class="colour">
<li><strong>Handle </strong>- The OpenAL source handle (unique for every sound played)</li>
<li><strong>Data Handle</strong> - The OpenAL buffer handle (shows the same value for multiple sounds with the same source handle)</li>
<li><strong>Processed Buffers</strong> - how many buffers have been played</li>
<li><strong>Queued Buffers</strong> - how many buffers have been queued (and are still waiting to play)</li>
<li><strong>Gain </strong>- The gain value for the audio (0 - 65536)</li>
<li><strong>Play Offset</strong> - the sample position (current play position) into the current buffer</li>
<li><strong>Queued Buffers Bars</strong> - a small box diagram of the processed/queued buffers with the play offset (current position) drawn as a blue line</li>
</ul>
<p>For synchronised groups of audio, you also have the function <a href="Audio_Synchronisation/audio_sync_group_debug.htm"><tt>audio_sync_group_debug()</tt></a>.</p>
<p class="note"><b>NOTE: </b>This function does not work on the HTML5 target platform.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">audio_debug(enable);</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
<tr>
<td>enable</td>
<td>Enable (set to <tt>true</tt>) or disable (<tt>false</tt>) audio debugging.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code">N/A</p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (debug_mode)<br/> {
<br/> audio_debug(true);
<br/> }
<br/> else
<br/> {
<br/> audio_debug(false);
<br/> }
</p>
<p>The above code will switch on or off the audio debug overlay depending on whether the game is running in debug mode or not.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Audio.htm">Audio</a></div>
<div style="float:right">Next: <a href="audio_system_is_available.htm">audio_system_is_available</a></div>
<div style="float:right"> </div>
</div>
</div>
<h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
</div>
</body></html>