Optionalcontext: AudioContext
An AudioContext to use instead of creating one -- lets tests (and any code
that already owns a shared context) inject their own instead of relying on the global
window.AudioContext.
Loads an audio file and decodes it into a buffer.
The URL of the audio file.
The unique name to identify the sound.
Plays a global (non-spatial) sound.
Generates a retro synthesized footstep thud. See SynthSFX.playFootstep.
Generates a retro "Ugh!" hurt sound. See SynthSFX.playHurt.
Plays a global (non-spatial) music track through the music bus, so it responds to
setMusicVolume() independently of sound effects.
Generates a retro "Pew Pew" laser/gunshot sound. See SynthSFX.playShoot.
Plays a 3D spatial sound at a given position.
Generates a procedural synth tone (e.g., for musical instruments or physical impacts).
See SynthSFX.playTone.
The base frequency in Hz.
The duration of the tone in seconds.
The starting volume.
The oscillator type.
Must be called after a user interaction to resume the audio context on some browsers.
Set the global master volume (0.0 to 1.0)
Set the Music volume (0.0 to 1.0)
Set the Reverb level (0.0 to 1.0)
Set the SFX volume (0.0 to 1.0)
Starts a creepy, pulsing low-frequency background drone. See SynthSFX.startDrone.
Starts a procedural fire crackling noise at a specific 3D location. See SynthSFX.startFire.
Updates the global listener position and orientation based on the camera.
A basic Audio System that wraps the Web Audio API. Supports loading sounds and playing them globally or spatially.