audio-and-sound

Automate audio loading, playback, and global control in Phaser 4 games.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/Raphe-dev/phaser-cozy-mmo --skill audio-and-sound
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-and-sound
Source: https://github.com/Raphe-dev/phaser-cozy-mmo/tree/main/skills/audio-and-sound
Command: npx skills add https://github.com/Raphe-dev/phaser-cozy-mmo --skill audio-and-sound

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralizes and simplifies audio management in Phaser 4 games by providing a unified sound system that handles loading, playback, volume, panning, looping, markers, audio sprites, spatial audio, and autoplay policy unlocking.

Core Features & Use Cases

  • Unified sound management through this.sound, enabling play, add, pause, stop, and global control over volume, rate, and detune.
  • WebAudio vs HTML5 Audio support with automatic backend selection and spatial audio capabilities for WebAudio, plus fallbacks for HTML5.
  • Support for common patterns like fire-and-forget plays and retained references, including audio sprites, markers, and spatial cues that follow game objects.

Quick Start

Load audio assets in preload and start playback in create using the sound manager (e.g., this.sound.play('bgm') or this.sound.add('bgm') followed by play()).

Frequently Asked Questions about audio-and-sound

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add background music and sound effects to a Phaser game?

To add Phaser audio, load assets in the preload phase and trigger playback in create using this.sound.play for fire-and-forget sound effects or this.sound.add for retained references and background music control.

Does Phaser 4 support spatial audio and Web Audio API features?

Phaser 4 spatial audio is supported through the WebAudio backend, enabling panning and positional sound cues that follow game objects, with automatic fallback to HTML5 Audio when WebAudio is unavailable.

How do I manage audio sprites and markers in HTML5 game development?

Audio sprites and markers in HTML5 game development are managed via the centralized sound system, allowing you to define specific timestamps within a single audio file and trigger them using this.sound.add with marker configurations.

Can I globally control volume, rate, and detune for all sounds in a Phaser scene?

Global control of volume, rate, and detune for all sounds in a Phaser scene is handled centrally through the unified sound manager, applying configurations across both WebAudio and HTML5 Audio backends consistently.

Why does my Phaser game audio fail to play on mobile browsers?

Phaser game audio fails to play on mobile browsers due to autoplay policies, which the sound system addresses by automatically handling audio unlocking to ensure sounds trigger correctly after user interaction.