🔊 Loads audio data from a file and returns an HTMLAudioElement.
Audio is considered loaded when the canplaythrough event is fired.
Note that audio can only be played after the first user interaction with the page!
await Canvas(200);let audio = loadAudio('/assets/retro.flac');audio.volume = 0.4;q5.mousePressed = function () { audio.play();}; Copy
await Canvas(200);let audio = loadAudio('/assets/retro.flac');audio.volume = 0.4;q5.mousePressed = function () { audio.play();};
🔊 Loads audio data from a file and returns an HTMLAudioElement.
Audio is considered loaded when the canplaythrough event is fired.
Note that audio can only be played after the first user interaction with the page!