audio-mobile

Initialize AudioContext on first user interaction for mobile audio playback.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/neighbor-game-ai/DreamCore-V2-sandbox --skill audio-mobile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-mobile
Source: https://github.com/neighbor-game-ai/DreamCore-V2-sandbox/tree/main/.claude/skills/audio-mobile
Command: npx skills add https://github.com/neighbor-game-ai/DreamCore-V2-sandbox --skill audio-mobile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

モバイルブラウザはユーザー操作なしでは音声再生を開始できません。このスキルは、iOS/Android 環境での音声初期化パターンを提供します。

Core Features & Use Cases

  • Web Audio API を用いた初期化と音声再生の確実化。
  • Howler.js を用いた unlock パターンによる音声初期化の安定化。
  • 実務的なユースケースとして、ユーザーが画面をタップした際に音声を開始するアプリの実装サポート。

Quick Start

音声を有効にするには、initAudio() をユーザー操作後に呼び出してください。

Frequently Asked Questions about audio-mobile

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

FAQPage Schema
How do I enable mobile audio playback on iOS and Android browsers?

Mobile browsers require an AudioContext to be initialized after a user interaction. This skill applies the Web Audio API and Howler.js unlock pattern, attaching touchstart and click event listeners to resume audio context reliably across iOS and Android platforms.

Why does audio not start automatically in mobile web browsers without a tap?

Audio does not start automatically because mobile browsers block sound until a user interacts with the page. The initAudio function resolves this by resuming the suspended AudioContext on the first touchstart or click event, ensuring subsequent playback succeeds.

How do I use Howler.js to unlock the Web Audio API on touch devices?

To unlock the Web Audio API with Howler.js, call an initAudio function during a user's first tap or click. This action resumes the suspended AudioContext and attaches interaction listeners, stabilizing audio initialization for mobile web applications.

Does the Web Audio API require a user gesture to resume the AudioContext on mobile?

Yes, the Web Audio API requires a user gesture to resume the AudioContext on mobile. This skill attaches touchstart and click event listeners to trigger the initialization, satisfying the browser's security policy for media playback.

What is the best way to initialize a Web Audio API AudioContext for mobile games?

The best way to initialize an AudioContext for mobile games is implementing an unlock pattern on first interaction. This skill provides a minimal initAudio function that resumes the context and binds touchstart and click events to ensure reliable audio playback.

Are there limitations to using touchstart events for mobile audio initialization?

A limitation of mobile audio initialization is that it strictly requires a physical user interaction before playing sound. The initAudio function mitigates this by listening to both touchstart and click events to resume the AudioContext, covering multiple interaction types.