Reference loadSound()

loadSound()

loadSound() returns a new SoundFile from a specified path. Call loadSound() from an async function with await to ensure the sound is loaded before use.

Examples

Syntax

loadSound(path)

Parameters

path
String|Array: Path to the sound file, or an array with paths to soundfiles in multiple formats i.e. ['sound.ogg', 'sound.mp3']. Alternately, accepts an object: either from the HTML5 File API, or a p5.File.

Returns

SoundFile: Returns a SoundFile

Related References