AudioPlay
:play
(time?: number): voidStart playing audio.
since
v3000.0
seek
(time: number): voidSeek time.
since
v3000.0
stop
(): voidStop the sound.
since
v3001.0
paused
: booleanIf the sound is paused.
since
v2000.1
speed
: numberPlayback speed of the sound. 1.0 means normal playback speed, 2.0 means twice as fast.
detune
: numberDetune the sound. Every 100 means a semitone.
// tune down a semitone
music.detune = -100
// tune up an octave
music.detune = 1200
volume
: numberVolume of the sound. 1.0 means full volume, 0.5 means half volume.
pan
?: numberThe stereo pan of the sound. -1.0 means fully from the left channel, 0.0 means centered, 1.0 means fully right. Defaults to 0.0.
loop
: booleanIf the audio should start again when it ends.
time
(): numberThe current playing time (not accurate if speed is changed).
duration
(): numberThe total duration.
onEnd
(action: () => void): KEventControllerRegister an event that runs when audio ends.
since
v3000.0