Optional
pSoundPath: stringThe path of the sound file
Optional
pVolume: numberThe volume of the sound
Optional
pStartTime: numberThe start time of this sound (to play a clipped version)
Optional
pEndTime: numberThe end time of this sound (to play a clipped version)
Optional
pSave: booleanWhether to save this sound, or recycle it when it's completed
Optional
pPlayUnfocused: booleanIf this sound is set to playUnfocused then it will not be played automatically when the game screen is not focused
Optional
pPlaybackRate: numberThe rate at which the sound is played, Higher numbers for faster playback (MAX 10)
Optional
pLoop: booleanWhether this sound should loop or not
The path of the sound.
The start time of this sound.
The end time of ththise sound.
Whether to save this sound or not.
The duration of this sound.
The source of this sound.
The gain node of this sound.
Whether this sound is loaded.
If this sound is to play after it is loaded.
If this sound is muted.
The state of this sound.
The start timestamp of this sound.
The timestamp of this sound when it was paused so it can be resumed at the same timestamp.
If this sound plays without window focus.
Object holding the fading information for this sound.
Events tied to this sound. start | end | pause | resume
Array of filters that are currently applied on this sound.
Whether this sound was sent a stop signal.
If this sound is to loop.
The playback rate of this sound.
The volume of this sound.
Info tied to this sound.
Gets the current volume of this sound
The current volume of this sound
Sets the volume of this sound
The volume to set
Get the loop status of this sound
Whether this sound is set to loop or not
Set the loop status of this sound
The value which to set the loop status to. Truthy values resolve to true, and falsely values resovle to false
Get the playback status of this sound
The playback rate of this sound
Set the playback status of this sound
The value which to set the playback status to. Clamped to 10
Get the info object of this sound
The info object of this sound
Set the info of this sound The new value is not used, as this is a "read-only" variable. So any attempts to set it will not work
The new value
Optional
pSoundPath: stringThe path of the sound file
The volume of the sound
The start time of this sound (to play a clipped version)
The end time of this sound (to play a clipped version)
Whether to save this sound, or recycle it when it's completed
If this sound is set to true then it will not be paused automatically when the game screen is not focused
The rate at which the sound is played, Higher numbers for faster playback (MAX 10)
Whether this sound should loop or not
Fades this sound to the specified volume in the specified duration via the specified ease
Optional
pVolume: number = 100The volume to fade to
Optional
pDuration: number = 5000The duration of the fade in ms
Optional
pEase: string = 'easeOutCubic'Easing function
Optional
pCallback: (() => void)Callback to be called when the fade is over
This sound instance
A small class to represent a sound. Has useful API to handle the sound.
Sound