AudioPlay:

play(time?: number): void

Start playing audio.

sincev3000.0

seek(time: number): void

Seek time.

sincev3000.0

stop(): void

Stop the sound.

sincev3001.0

paused: boolean

If the sound is paused.

sincev2000.1

speed: number

Playback speed of the sound. 1.0 means normal playback speed, 2.0 means twice as fast.

detune: number

Detune the sound. Every 100 means a semitone.
// tune down a semitone
music.detune = -100

// tune up an octave
music.detune = 1200

volume: number

Volume of the sound. 1.0 means full volume, 0.5 means half volume.

loop: boolean

If the audio should start again when it ends.

time(): number

The current playing time (not accurate if speed is changed).

onEnd(action: ()=>void): KEventController

Register an event that runs when audio ends.

sincev3000.0

then(action: ()=>void): KEventController

kaplay logo

3001.0.0-alpha.18

Misc