Skip to content

Commit

Permalink
[General]Manual+In-Game: Feather/Manual info for audio_destroy_stream…
Browse files Browse the repository at this point in the history
…() is incorrect, and the function does not return its intended value correctly

YoYoGames/GameMaker-Bugs#4415
* Changed the parameter: renamed to "sound", type changed to Sound Asset, return value to Real (int32 isn't a type we've documented so far in the manual)
* Tiny other changes to the page
  • Loading branch information
YYBartT committed Jan 19, 2024
1 parent a5d50df commit 4fa0ae8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>audio_create_stream</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css" />
<script src="../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand All @@ -16,8 +16,8 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">audio_create_stream</span></h1>
<p>With this function you can create a new sound index which can then be used in the regular audio functions to stream audio directly from an external OGG file source.</p>
<p>The function requires the filename (which can be an included file, for example) and will return the new sound index for use.</p>
<p>With this function you can create a new sound which can then be used in the regular audio functions to stream audio directly from an external OGG file source.</p>
<p>The function requires the path to the file (which can be an included file, for example) and will return the new sound for use.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> After you no longer need the sound you should call the function <span class="inline2"><a data-xref="{title}" href="audio_destroy_stream.htm">audio_destroy_stream</a></span> with the sound index to remove it from memory otherwise you may get a memory leak. This will slow down and eventually crash your game.</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> This functionality is not available for the HTML5 target platform.</p>
<p> </p>
Expand All @@ -32,19 +32,19 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>filename</td>
<td><span data-keyref="Type_String"><a href="../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">String</a></span></td>
<td><span data-keyref="Type_String"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">String</a></span></td>
<td>Path to the file (OGG only) to stream the audio from.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Asset_Sound"><a href="../../../../../The_Asset_Editors/Sounds.htm" target="_blank">Sound Asset</a></span></p>
<p class="code"><span data-keyref="Type_Asset_Sound"><a href="../../../../The_Asset_Editors/Sounds.htm" target="_blank">Sound Asset</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">snd = <span data-field="title" data-format="default">audio_create_stream</span>(&quot;Music/Track1.ogg&quot;);<br />
audio_play_sound(snd, 0, true);</p>
<p>The above code creates a new sound index in the variable &quot;snd&quot; from the given file, then plays this sound.</p>
<p>The above code creates a new sound index in the variable <span class="inline2">snd</span> from the given file, then plays this sound.</p>
<p> </p>
<p> </p>
<div class="footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>audio_destroy_stream</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css" />
<script src="../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand All @@ -16,13 +16,13 @@
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">audio_destroy_stream</span></h1>
<p>If you have previously created an audio stream from a file using the function <span class="inline2"><a data-xref="{title}" href="audio_create_stream.htm">audio_create_stream</a></span>
<font face="menlo, consolas, monospace"><span style="font-size: 17px;"> </span></font>and no longer need that sound, you can call this function to delete it from memory. Any further calls to the sound index after it has been destroyed will give an error.
<font face="menlo, consolas, monospace"><span style="font-size: 17px;"> </span></font>and no longer need that sound, you can call this function to delete it from memory. Any further calls to the sound after it has been destroyed will give an error.
</p>
<p class="note"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> This will free up the stream but on the target platform this may not show up in a memory manager. This is because <span data-keyref="GameMaker Name">GameMaker</span> pools memory resources to prevent memory allocation overhead, and so the memory will remain allocated until required for something else or re-used for a new stream.</p>
<p class="note"><b><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> </b>This functionality is not available for the HTML5 target platform.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">audio_destroy_stream</span>(filename);</p>
<p class="code"><span data-field="title" data-format="default">audio_destroy_stream</span>(sound);</p>
<table>
<tbody>
<tr>
Expand All @@ -31,19 +31,19 @@ <h4>Syntax:</h4>
<th>Description</th>
</tr>
<tr>
<td>filename</td>
<td><span data-keyref="Type_String"><a href="../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">String</a></span></td>
<td>Path to the audio file that was streamed.</td>
<td>sound</td>
<td><span data-keyref="Type_Asset_Sound"><a href="../../../../The_Asset_Editors/Sounds.htm" target="_blank">Sound Asset</a></span></td>
<td>The sound asset, as returned by <span class="inline3_func"><a data-xref="{title}" href="audio_create_stream.htm">audio_create_stream</a></span></td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p class="code"><span data-keyref="Type_Real"><a href="../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span> (1 if the stream was successfully destroyed, -1 if it wasn&#39;t)</p>
<p> </p>
<h4>Example:</h4>
<p class="code"><span data-field="title" data-format="default">audio_destroy_stream</span>(snd);</p>
<p>The above code removes the sound indexed in the variable &quot;snd&quot; from memory.</p>
<p>The above code removes the sound stored in the variable <span class="inline2">snd</span> from memory.</p>
<p> </p>
<p> </p>
<div class="footer">
Expand All @@ -53,7 +53,7 @@ <h4>Example:</h4>
<div style="float:right">Next: <a data-xref="{title}" href="audio_exists.htm">audio_exists</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
audio_destroy_stream
Expand Down

0 comments on commit 4fa0ae8

Please sign in to comment.