Called when the sound has finished or failed to load.
Called when playback of the sound has finished. Not called when the sound is interrupted (for example by calling stop) or while the sound is played in a loop.
Destroy this sound and free its resources. Call this function when you don't need a loaded sound anymore. The object will become non-functional, and it will be removed from the cache. Note that multiple calls to GameWorld.importSound or GameWorld.importSoundFromURL with the same parameters return the same object when using caching, so if you use the same sound at multiple places in your code, you should be careful when you destroy it.
Return the duration of the sound in seconds. Will be 0 if the sound is not loaded.
Return the current playback time of the sound as a fraction of its duration. Will be 0 if the sound is not playing.
Return the current playback time of the sound in seconds. Will be 0 if the sound is not playing.
Return whether the sound has finished loading successfully and is ready to play
Return whether the sound is currently playing
Start playing the sound. It will not appear to come from any location. If it is already playing, the playback time will be moved. If the sound isn't loaded yet when this method is called, the sound will be played as soon as loading has finished.
The starting playback time. Set to 0 to play from the beginning. Default: 0
The volume multiplier at which to play the sound, 0 < volume < 2. Default: 1
Determines for which players the sound will be played. By default, it will be played for all players
Start playing the sound at a given position. If it is already playing, the playback time will be moved. If the sound isn't loaded yet when this method is called, the sound will be played as soon as loading has finished.
The position where the sound should originate.
The starting playback time. Set to 0 to play from the beginning. Default: 0
The volume multiplier at which to play the sound, 0 < volume < 2. Default: 1
Determines for which players the sound will be played. By default, it will be played for all players
Start playing the sound at the location of an object. It will move together with the object. If the sound is already playing, the playback time will be moved. If the sound isn't loaded yet when this method is called, the sound will be played as soon as loading has finished.
The object from which the sound should originate.
The starting playback time. Set to 0 to play from the beginning. Default: 0
The volume multiplier at which to play the sound, 0 < volume < 2. Default: 1
Determines for which players the sound will be played. By default, it will be played for all players
Stop playing the sound immediately
Stop looping the sound if it is currently played in a loop. Doesn't stop playback immediately, only after the current playback finishes. Has no effect if the sound is not currently played in a loop.
A sound that can be played. Create Sound objects by importing sound files using GameWorld.importSound or GameWorld.importSoundFromURL.