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:
Name | Type | Description |
---|---|---|
id | string | Identifier of sound to get |
Returns:
Audio with specified identifier, if it exists
- Type:
- Audio |
null
load(id, path)
Load a sound from files.
Parameters:
Name | Type | Description |
---|---|---|
id | string | ID/name of sound for later access |
path | string | Path to file |
path(p)
Set the working directory for importing sprites.
Parameters:
Name | Type | Description |
---|---|---|
p | string | New working path |