AudioSource
Index
Constructors
constructor
Parameters
mixer: AudioMixer
clip: AudioClip
Returns AudioSource
Properties
clip
gain
mixer
source
station
Accessors
destroyed
Check if the audio source destroyed
Returns boolean
loop
Get if the source is looping
Returns boolean
Set if the source is looping
Parameters
value: boolean
Returns void
time
Get the current progress of the source
Returns number
Set the current progress of the source, seek the source
Parameters
value: number
Returns void
volume
Get the volume of this source
Returns number
Set the volume of this source
Parameters
value: number
Returns void
Methods
addEndHandler
Add a handler to be called when the audio source end itself without manually stop
Parameters
handler: () => void
Returns void
destroy
Dispose the audio source
Returns void
fade
Fade the audio source from a start volume to an end volume May be interrupted by stop, pause, suspend, set volume, or another fade
Parameters
startVolume: number
endVolume: number
duration: number
Returns void
isPlaying
Returns boolean
pause
Pause the source
Returns void
play
Play or resume the source Do not works when the source is already playing
Returns void
removeEndHandler
Remove a handler previously added by
addEndHandlerParameters
handler: () => void
Returns void
replaceAudioContext
Replace audio context used in this source Should be only used by AudioMixer#replaceAudioContext
Parameters
newAudioContext: IAudioContext
newMixerNode: gainNodeConstructor<IAudioContext>
Returns void
resume
Resume the source, this should only be called from mixer
Returns void
stop
Stop the source, same as pause and seek to 0
Returns void
suspend
Suspend the source, this should only be called from mixer
Returns void
The audio source