audio-and-sound

Integrates Phaser 4 audio to load, play and manage sounds and music across scenes.

40.1k|7.2k|Updated Apr 12, 2013
One-click install
npx skills add https://github.com/phaserjs/phaser --skill audio-and-sound-phaserjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-and-sound
Source: https://github.com/phaserjs/phaser/tree/main/skills/audio-and-sound
Command: npx skills add https://github.com/phaserjs/phaser --skill audio-and-sound-phaserjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phaser developers often struggle to implement consistent audio behavior across scenes, devices, and formats. This skill provides a unified framework to load, play, adjust, and control sounds and music using Phaser 4's SoundManager, Web Audio, and HTML5 fallback.

Core Features & Use Cases

  • Global and per-sound controls: volume, rate, detune, mute, pan.
  • Background music, sound effects, and spatial audio (WebAudio-only).
  • Markers, audio sprites, and runtime decoding support.
  • Automatic unlock handling for mobile browsers and event-driven lifecycle management.

Quick Start

Load a track and start playback to verify the audio system in your Phaser 4 game.

Frequently Asked Questions about audio-and-sound

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

FAQPage Schema
How do I manage audio across multiple scenes in Phaser?

Load and play game sounds in Phaser 4 using the SoundManager, which supports Web Audio and HTML5 fallback. It provides unified sound management for loading, playing, and adjusting audio across scenes.

Does Phaser support spatial audio and per-sound volume control?

Yes, Phaser supports spatial audio on WebAudio and provides per-sound controls for volume, rate, detune, mute, and pan. Global volume and rate controls are also available through the SoundManager API.

What is the best way to handle audio sprites and markers in game development?

Use Phaser's SoundManager markers and runtime decoding support to handle audio sprites in game development. This enables precise playback control over specific audio segments within a single loaded track.

Why does audio fail to play on mobile browsers in Phaser?

Audio fails on mobile browsers due to autoplay restrictions. Phaser's SoundManager includes automatic unlock handling for mobile browsers, ensuring audio playback triggers correctly after a user interaction.

Can I use Web Audio and HTML5 fallback together for Phaser sound management?

Yes, you can use Web Audio and HTML5 fallback together for Phaser sound management. The SoundManager automatically applies the appropriate fallback to ensure audio playback works across different devices and formats.