AudioManager.ts

src/systems/AudioManager.ts
import { Howl, Howler, type HowlOptions } from 'howler';
/**
* Audio system built on Howler.js. Howler is the standard for web games:
* Web Audio + HTML5 fallback, sprite slicing, fades, master volume, mute.
*
* Howler auto-handles AudioContext unlocking on the first user gesture, so
* you don't need to manually call resume() — just register sounds in
* PreloadScene and play them by key.
*
* Usage:
* await game.audio.register(ASSETS.audio.pickup, 'assets/audio/pickup.wav');
* game.audio.play(ASSETS.audio.pickup);
*/
export class AudioManager {
private sounds = new Map<string, Howl>();
private muted = false;
/** Master volume, 0–1. */
setVolume(value: number): void {

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC