SoundRegistry

Loads audio from files and allow for easily and ready access.

Constructor

new SoundRegistry()

Create a new sound loader.

Methods

get(id) → {Audio|null}

Get a sound based on its ID, if it has been loaded.
Parameters:
NameTypeDescription
idstringIdentifier of sound to get
Returns:
Audio with specified identifier, if it exists
Type: 
Audio | null

load(id, path)

Load a sound from files.
Parameters:
NameTypeDescription
idstringID/name of sound for later access
pathstringPath to file

path(p)

Set the working directory for importing sprites.
Parameters:
NameTypeDescription
pstringNew working path