audio-and-sound

Manage audio playback, volume, and mute in Phaser 4 games.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/kehwar/pixi-square --skill audio-and-sound-kehwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-and-sound
Source: https://github.com/kehwar/pixi-square/tree/main/.agents/skills/audio-and-sound
Command: npx skills add https://github.com/kehwar/pixi-square --skill audio-and-sound-kehwar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phaser games commonly struggle to reliably load and play audio across Web Audio and HTML5 backends, manage volume and panning, and coordinate sound events within a cohesive system.

Core Features & Use Cases

  • Unified Sound system via this.sound that abstracts Web Audio and HTML5 Audio
  • Load, play, pause, stop, and loop sounds with per-sound and global configuration
  • Spatial audio, markers, and audio sprites for immersive sound design

Quick Start

Load audio assets in preload and start playback with this.sound.play() in create.

Frequently Asked Questions about audio-and-sound

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

FAQPage Schema
How do I play sound effects and background music in a Phaser 4 game?

To play sound effects and background music in Phaser 4, load audio assets during the preload phase and trigger playback using this.sound.play() in the create phase. This unified sound system manages both Web Audio and HTML5 Audio fallbacks.

How does spatial audio work with Phaser 4 game development?

Spatial audio in Phaser 4 game development works by applying position-based panning and volume configurations to sound instances. This creates immersive sound design by altering audio output based on in-game spatial locations.

Does Phaser 4 audio support Web Audio and HTML5 fallbacks for browser autoplay policies?

Yes, Phaser 4 audio supports Web Audio and HTML5 fallbacks for browser autoplay policies. The unified sound system abstracts both backends, ensuring reliable playback control across different browser environments.

What is the best way to manage volume and mute audio globally in Phaser 4?

The best way to manage volume and mute audio globally in Phaser 4 is through the this.sound system, which provides global configuration controls alongside per-sound adjustments for pausing, stopping, and looping audio events.

Can I use audio sprites and markers for sound design in Phaser 4?

Yes, you can use audio sprites and markers for sound design in Phaser 4. The sound system supports these features to help coordinate precise sound events and manage complex audio playback within gameplay scenarios.

Why are my Phaser 4 sounds not loading or playing during gameplay events?

Phaser 4 sounds may fail to load or play if audio assets are not properly loaded in the preload phase or if event hooks are misconfigured. The system requires correct sound instantiation and playback control setup.