audio-and-sound

Configure Phaser 4 SoundManager for audio loading and playback control.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill audio-and-sound-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-and-sound
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/audio-and-sound
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill audio-and-sound-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of adding consistent audio and sound effects to a Phaser 4 game across browsers by explaining how Phaser’s unified SoundManager loads, plays, and controls audio.

Core Features & Use Cases

  • Load and play audio consistently: Use Phaser’s loader and SoundManager to play sound effects and background music with predictable behavior.
  • Control playback with Sound Instances: Create persistent sound instances to adjust volume, rate, detune, seek, looping, mute, and stop/pause/resume as gameplay changes.
  • Handle modern audio needs: Configure spatial audio via Web Audio (listener position, panning, and source tracking) and support cross-browser differences with format fallbacks.

Quick Start

Tell the skill to help you load a background music track and a looping sound effect, then start the music in your scene’s create method.

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 4 game?

To add background music and sound effects in Phaser 4, use this.load.audio in the preload method to load audio files, then manage playback via this.sound.play or this.sound.add in your scene to trigger sound effects and start looping background music.

How does spatial audio work with the Phaser Web Audio backend?

Spatial audio in Phaser uses the Web Audio backend to configure listener position and sound source tracking. You can enable spatial audio by adjusting panning and tracking source positions relative to the listener during runtime playback.

Can I control audio playback volume and mute state during gameplay?

You can control audio playback during gameplay by creating persistent sound instances via this.sound.add. These instances support adjusting volume, mute, rate, detune, and executing stop, pause, and resume commands as gameplay changes.

Why does my Phaser game audio fail to play automatically in the browser?

Browser autoplay policies often block audio from playing automatically without user interaction. Phaser handles this by unlocking the Web Audio or HTML5 audio backend, requiring a user input event to initialize the SoundManager before playback starts.

Does Phaser 4 support both Web Audio and HTML5 audio backends?

Phaser 4 supports both Web Audio and HTML5 audio backends through its unified SoundManager. This allows you to handle cross-browser differences and configure format fallbacks for consistent audio loading and playback.

What is the best way to handle cross-browser audio format fallbacks in Phaser?

The best way to handle cross-browser audio fallbacks in Phaser is to load multiple audio formats using this.load.audio. Phaser's SoundManager automatically selects the compatible WebAudio or HTML5 backend to ensure consistent playback.