<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Sound.adjust</id>
	<title>Sound.adjust - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://miniscript.org/w/index.php?action=history&amp;feed=atom&amp;title=Sound.adjust"/>
	<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Sound.adjust&amp;action=history"/>
	<updated>2026-05-03T21:45:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>http://miniscript.org/w/index.php?title=Sound.adjust&amp;diff=1068&amp;oldid=prev</id>
		<title>JoeStrout: Created page with &quot;&lt;c&gt;Sound.adjust&lt;/c&gt; changes the volume, pan, and/or speed of an already-playing sound.  Call this on a Sound object after Sound.play.  === Arguments ===  {| class=...&quot;</title>
		<link rel="alternate" type="text/html" href="http://miniscript.org/w/index.php?title=Sound.adjust&amp;diff=1068&amp;oldid=prev"/>
		<updated>2023-01-26T20:20:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;c&amp;gt;&lt;a href=&quot;/wiki/Sound&quot; title=&quot;Sound&quot;&gt;Sound&lt;/a&gt;.adjust&amp;lt;/c&amp;gt; changes the volume, pan, and/or speed of an already-playing sound.  Call this on a &lt;a href=&quot;/wiki/Sound&quot; title=&quot;Sound&quot;&gt;Sound&lt;/a&gt; object after &lt;a href=&quot;/wiki/Sound.play&quot; title=&quot;Sound.play&quot;&gt;Sound.play&lt;/a&gt;.  === Arguments ===  {| class=...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;c&amp;gt;[[Sound]].adjust&amp;lt;/c&amp;gt; changes the volume, pan, and/or speed of an already-playing sound.  Call this on a [[Sound]] object after [[Sound.play]].&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Type !! Default Value !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| ''volume'' || number || 1 || volume (0-1) of the sound&lt;br /&gt;
|-&lt;br /&gt;
| ''pan'' || number || 0 || left (-1) to right (1) stereo pan of the sound&lt;br /&gt;
|-&lt;br /&gt;
| ''speed'' || number || 1 || speed multiplier (1 == standard speed)&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== Usage Notes ===&lt;br /&gt;
The sound will automatically stop if [[Sound.loop|.loop]] is false, but will repeat until explicitly&lt;br /&gt;
stopped if [[Sound.loop|.loop]] is true. Note that ''speed'' will change both the duration and pitch of the sound, due to changing the speed of the waveforms being played.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
The following example shows how to continuously adjust the speed and pan of a sound based on the position of the mouse.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ms&amp;gt;snd = file.loadSound(&amp;quot;/sys/sounds/celloLongC4.wav&amp;quot;)&lt;br /&gt;
snd.loop = true&lt;br /&gt;
snd.play&lt;br /&gt;
&lt;br /&gt;
while not key.pressed(&amp;quot;escape&amp;quot;)&lt;br /&gt;
	// play a sound, panning left/right according to mouse X position&lt;br /&gt;
	pan = mouse.x / 480 - 1&lt;br /&gt;
	speed = 1 + mouse.y / 320 - 0.5&lt;br /&gt;
	snd.adjust 1, pan, speed&lt;br /&gt;
	yield&lt;br /&gt;
end while&lt;br /&gt;
&lt;br /&gt;
snd.stop&amp;lt;/ms&amp;gt;&lt;br /&gt;
[[Category:Mini Micro]]&lt;/div&gt;</summary>
		<author><name>JoeStrout</name></author>
		
	</entry>
</feed>