Skip to main content

load

Summary

Register a sound effect under a unique key.

Signature

Parameters

sound

Type:string Unique key used to reference this sound (e.g. “explosion”).

file

Type:string URL or path to the audio file.

Returns

Type:void Register a sound effect under a unique key.

Remarks

Creates an HTMLAudioElement from the provided URL. The sound respects the current muted state at load time.