Difference between revisions of "Sound.play"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>Sound.play</c> plays a sound. Call this on a Sound object initialized either Sound.init, or loaded via file.loadSound. === Arguments === {| class="wikitable" |- ! Param...")
 
Line 1: Line 1:
<c>Sound.play</c> plays a sound.  Call this on a Sound object initialized either
+
<c>[[Sound]].play</c> plays a sound.  Call this on a Sound object initialized either
 
Sound.init, or loaded via file.loadSound.
 
Sound.init, or loaded via file.loadSound.
 
  
 
=== Arguments ===
 
=== Arguments ===

Revision as of 22:58, 1 April 2020

Sound.play plays a sound. Call this on a Sound object initialized either Sound.init, or loaded via file.loadSound.

Arguments

Parameter Name Type Default Value Meaning
volume number 1 volume (0-1) of the sound
pan number 0 left (-1) to right (1) stereo pan of the sound
speed number 1 speed multiplier (1 == standard speed)

Usage Notes

the sound will automatically stop if .loop is false, but will repeat until explicitly stopped if .loop is true.

Example

s = file.loadSound("/sys/sounds/bonus.wav")
s.play