Difference between revisions of "Discard.sound"

From AGI Wiki
Jump to navigationJump to search
Line 1: Line 1:
{{Stub}}
+
The '''discard.sound''' command unloads a [[Sound Resource (AGI)|sound]] resource from the [[memory heap]].
  
<div align="center" style="font-size: 22pt">'''discard.sound'''</div>&nbsp;
+
== Syntax ==
<div align="center">'''''&nbsp;'''''</div>
 
  
==<br /> Description ==
+
discard.sound([[number|byt]] A);
  
<blockquote>
+
== Remarks ==
The AGI sound command <code>[[discard.sound]]</code> is only available on Amiga v3 interpreters.
 
</blockquote>
 
  
==<br /> Syntax ==
+
In the PC version of AGI, this command points to a null function, and does nothing.
  
<blockquote>
+
Early versions of AGI did not include a command to unload [[Sound Resource (AGI)|sound]] resources. Since sounds were usually small and only used in limited circumstances, this was not usually a problem. Beginning with [[version]] 2.938, Sierra added this command to allow sounds to be unloaded once they were no longer needed. However, they did not make the command functional in the PC version; it only unloads sounds in non-PC interpreters.
Place holder
 
</blockquote>
 
  
==<br /> Remarks ==
+
== Possible Errors ==
  
<blockquote>
+
Presumably, attempting to discard a [[Sound Resource (AGI)|sound]] that hasn't been loaded will cause errors and crash AGI.
Place holder
 
</blockquote>
 
  
==<br /> Example ==
+
== Example ==
  
<blockquote>
 
 
<div class="CodeBlockHeader">Code:</div>
 
<div class="CodeBlockHeader">Code:</div>
 
<syntaxhighlight lang="agi">
 
<syntaxhighlight lang="agi">
discard.sound(22);
+
discard.sound(12); [ does nothing on PC based system
 +
                    [ on non-PC system, sound #12 is unloaded
 
</syntaxhighlight>
 
</syntaxhighlight>
</blockquote>
 
  
==<br /> Technical Information ==
+
== Technical Information ==
  
{| class="wikitable"
+
{| border="1" cellpadding="2"
! Required interpreter version!!Bytecode Value
+
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
 +
| width="175" | Available in version 2.936 and above, on non-PC interpreters.
 
|-
 
|-
| Amiga v3 interpreters||&nbsp;
+
| style="background-color: #efefef" | '''Byte-Code Value:'''
 +
| 175 (0xAF hex)
 
|}
 
|}
  
==<br /> Sources ==
+
== See Also ==
  
* [[AGI Specifications|AGI Specifications version 3.0]]
+
[[Sound Commands]]<br />
 
+
[[Category:Commands]]<br />
== References ==
 
 
 
<references />
 
 
 
==<br /> See Also ==
 
 
 
* [[Sound Resource (AGI)]]
 
* [[Sound Commands|Sound Commands]]
 
** <code>[[sound|sound]]</code>
 
** <code>[[load.sound]]</code>
 
** <code>[[stop.sound]]</code>
 
** <code>[[discard.sound]]</code>
 
* [[AGI Specifications: Chapter 4 - The Logic Language#stop.sound|AGI Specifications: Chapter 4 - The Logic Language stop.sound]]
 
* [[Logic Commands by Name|Commands]]
 
* [[AGI Command Reference]]
 
 
 
&nbsp;
 
 
 
[[Category:Sound Commands]]
 
[[Category:Logic]]
 

Revision as of 22:22, 29 March 2019

The discard.sound command unloads a sound resource from the memory heap.

Syntax

discard.sound(byt A);

Remarks

In the PC version of AGI, this command points to a null function, and does nothing.

Early versions of AGI did not include a command to unload sound resources. Since sounds were usually small and only used in limited circumstances, this was not usually a problem. Beginning with version 2.938, Sierra added this command to allow sounds to be unloaded once they were no longer needed. However, they did not make the command functional in the PC version; it only unloads sounds in non-PC interpreters.

Possible Errors

Presumably, attempting to discard a sound that hasn't been loaded will cause errors and crash AGI.

Example

Code:

<syntaxhighlight lang="agi"> discard.sound(12); [ does nothing on PC based system

                   [ on non-PC system, sound #12 is unloaded

</syntaxhighlight>

Technical Information

Required Interpreter Version: Available in version 2.936 and above, on non-PC interpreters.
Byte-Code Value: 175 (0xAF hex)

See Also

Sound Commands