To listen to an event, use the following method:
audio.on(eventType: string, callback: (param: { data: any }) => void)
ready Triggered after the audio file has been loaded and decoded. data returns a AudioBuffer with the following properties:
ready
data
AudioBuffer
duration
length
numberOfChannels
sampleRate
start Triggered as soon as the audio is played for the first time.
start
end Triggered as soon as the audio playback is complete.
end
state Fires when the audio context's state changes. data returns the possible values:
state
suspended
running
closed
There was an error while loading. Please reload this page.