Skip to main content

Table 5-5 Methods of Sound datatype

From: Audio

Method of Sounds Description
duration : Number Returns the sound clip’s duration in seconds
pan : Number Gets the pan setting: from -1 for full left to +1 for right
play : Nothing Plays the sound clip
play special(volume :
Number, pitch : Number, pan : Number) : Nothing
Plays the sound clip with values supplied for the panning, pitch and volume
pitch : Number Gets the pitch adjustment from -1 to +1
set pan(pan : Number) : Nothing Sets the pan setting: from -1 for full left to +1 for right
set pitch(pitch : Number) : Nothing Sets the pitch adjustment from -1 to +1
set volume(v : Number) : Nothing Sets the volume from 0 (silent) to +1 (full volume)
volume : Number Gets the volume, in range 0 (silent) to +1 (full volume)