<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Sound_Command</id>
	<title>Sound Command - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Sound_Command"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;action=history"/>
	<updated>2026-12-01T12:27:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=90162&amp;oldid=prev</id>
		<title>Andrew Branscom at 16:48, 8 April 2025</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=90162&amp;oldid=prev"/>
		<updated>2025-04-08T16:48:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:48, 8 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &#039;&#039;&#039;sound&#039;&#039;&#039; command plays a loaded [[sound resource]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &#039;&#039;&#039;sound&#039;&#039;&#039; command plays a loaded [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sound Resource (AGI)|&lt;/ins&gt;sound resource]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Syntax ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Syntax ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=90153&amp;oldid=prev</id>
		<title>Andrew Branscom: Andrew Branscom moved page Sound to Sound Command without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=90153&amp;oldid=prev"/>
		<updated>2025-04-08T16:36:48Z</updated>

		<summary type="html">&lt;p&gt;Andrew Branscom moved page &lt;a href=&quot;/index.php/Sound&quot; title=&quot;Sound&quot;&gt;Sound&lt;/a&gt; to &lt;a href=&quot;/index.php/Sound_Command&quot; title=&quot;Sound Command&quot;&gt;Sound Command&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:36, 8 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=89066&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=89066&amp;oldid=prev"/>
		<updated>2025-04-03T21:04:09Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:04, 3 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=89065&amp;oldid=prev</id>
		<title>en&gt;Andrew Korson: /* Remarks */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Sound_Command&amp;diff=89065&amp;oldid=prev"/>
		<updated>2019-04-23T02:49:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Remarks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;sound&amp;#039;&amp;#039;&amp;#039; command plays a loaded [[sound resource]].&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
sound([[number|byt]] SOUNDNUM, [[flag|flg]] fDONE);&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
When the &amp;#039;&amp;#039;&amp;#039;sound&amp;#039;&amp;#039;&amp;#039; command is called, AGI first checks to see if another [[Sound Resource (AGI)|sound]] is already playing. If so, AGI stops that sound (setting its &amp;#039;done&amp;#039; [[flag]] to TRUE). Then [[flag]] &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; is reset to FALSE.&lt;br /&gt;
&lt;br /&gt;
If the [[Sound Resource (AGI)|sound]] is valid, AGI then activates a vector function that begins asynchronously playing the sound (meaning it plays in the background while AGI continues to  run through [[interpreter cycles]]).&lt;br /&gt;
&lt;br /&gt;
If [[reserved flag]] [[f9 (sound enabled)]] is false, the [[Sound Resource (AGI)|sound]] won&amp;#039;t play, but the check for f9 does not occur until after the vector function tries to play the sound; it immediately cancels playback of sound and then sets [[flag]] &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; to true.&lt;br /&gt;
&lt;br /&gt;
When the [[Sound Resource (AGI)|sound]] stops playing for any reason (usually by reaching the end of the resource, or by issuing the &amp;#039;&amp;#039;&amp;#039;[[stop.sound]]&amp;#039;&amp;#039;&amp;#039; command) flag &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; is set to TRUE. Other situations that will stop a sound from playing and set the &amp;#039;done&amp;#039; flag are resetting [[f9 (sound enabled)]] to FALSE or using a &amp;#039;&amp;#039;&amp;#039;[[pause]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[quit]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[new.room]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[new.room.v]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[restart.game]]&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;[[restore.game]]&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;[[save.game]]&amp;#039;&amp;#039;&amp;#039; command. If any [[trappable error]] is raised, the sound will also stop and have [[flag]] &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039; set to TRUE.&lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
After resetting &amp;#039;&amp;#039;&amp;#039;fDONE&amp;#039;&amp;#039;&amp;#039;, AGI validates that sound resource &amp;#039;&amp;#039;&amp;#039;SOUNDNUM&amp;#039;&amp;#039;&amp;#039; is loaded. If it is not,  AGI raises [[trappable error #9]] and the command ends without doing anything else.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;agi&amp;quot;&amp;gt;&lt;br /&gt;
load.sound(22);&lt;br /&gt;
sound(22, f99);&lt;br /&gt;
if(isset(f99))&lt;br /&gt;
  {&lt;br /&gt;
  print(&amp;quot;sound is done playing.&amp;quot;);&lt;br /&gt;
  reset(f99);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical Information ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; width=&amp;quot;200&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Required Interpreter Version:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| width=&amp;quot;175&amp;quot; | Available in all AGI versions.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Byte-Code Value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| 99 (0x63 hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[Sound Commands]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Category:Commands]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Andrew Korson</name></author>
	</entry>
</feed>