audio-and-sound

Manages audio playback, loading, and spatial positioning in Phaser 4 games.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/Dominik-Steinweg/Fragdachse --skill audio-and-sound-dominik-steinweg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-and-sound
Source: https://github.com/Dominik-Steinweg/Fragdachse/tree/main/.agents/skills/audio-and-sound
Command: npx skills add https://github.com/Dominik-Steinweg/Fragdachse --skill audio-and-sound-dominik-steinweg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill simplifies the complexities of cross-browser audio management, handling the differences between Web Audio API and HTML5 Audio to ensure consistent sound playback in Phaser 4 games.

Core Features & Use Cases

  • Unified Sound Management: Provides a single interface for loading, playing, and controlling music and sound effects.
  • Advanced Audio Control: Supports spatial audio, stereo panning, volume modulation, and runtime decoding.
  • Use Case: Use this skill to implement a dynamic background music system that automatically pauses when the browser tab loses focus or to trigger spatial sound effects that follow moving game objects.

Quick Start

Use the audio-and-sound skill to load a background music file and play it as a looping track with a volume of 0.5.

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 playback in Phaser 4 across different browsers?

Spatial audio in Phaser 4 works by utilizing stereo panning and spatial positioning features to make sound effects follow moving game objects. This allows you to trigger positional audio that dynamically adjusts based on object location within the game environment.

Can I optimize game performance using audio sprites in Phaser 4?

Yes, you can optimize game performance in Phaser 4 by using audio sprite markers. This technique allows you to load a single audio file containing multiple sound effects, reducing HTTP requests and managing runtime decoding efficiently.

How do I loop background music and control its volume in a Phaser game?

To loop background music and control its volume in a Phaser game, you use the unified sound management interface to load an audio file and play it as a looping track with a specified volume, such as setting the volume parameter to 0.5.

Does Phaser 4 audio automatically pause when the browser tab loses focus?

Yes, Phaser 4 audio management can automatically pause background music when the browser tab loses focus. This dynamic audio system ensures playback halts gracefully without requiring manual event listener implementations.

What are the limitations of using HTML5 Audio versus Web Audio in game development?

Differences between Web Audio and HTML5 Audio backends in game development include varying latency and decoding behaviors. This audio management system abstracts these limitations, providing a consistent interface for volume modulation and looping across both platforms.