npx claudepluginhub fcsouza/agent-skills --plugin standalone-skillsThis skill uses the workspace's default tool permissions.
SFX generation, adaptive music, voice acting, and audio state machine integration for games. Covers **both** the ElevenLabs API (voice lines, SFX) **and** Vertex AI Lyria (music generation) as user-choosable alternatives. One skill, two providers, one unified audio pipeline.
Produces AI-generated music with Suno and Udio, sound effects with ElevenLabs, voice cloning, and audio enhancements. Activates on AI music, soundtrack, sound effects queries.
Game audio systems, music, spatial audio, sound effects, and voice implementation. Build immersive audio experiences with professional middleware integration.
Integrates music, SFX, VO, mixing, and reactive audio behaviors to support gameplay/UX. Use when implementing audio content, clarifying mixing, or ensuring cues aid gameplay/accessibility.
Share bugs, ideas, or general feedback.
SFX generation, adaptive music, voice acting, and audio state machine integration for games. Covers both the ElevenLabs API (voice lines, SFX) and Vertex AI Lyria (music generation) as user-choosable alternatives. One skill, two providers, one unified audio pipeline.
Trigger keywords: sound effects, SFX, music generation, voice acting, adaptive music, audio, ElevenLabs, Lyria, game audio, soundtrack, ambient sound, voice lines, text-to-speech, voice cloning, game music, audio state machine.
Use this skill when:
None. Provider-specific setup is covered in each client boilerplate.
ElevenLabs requires an API key (ELEVENLABS_API_KEY).
Vertex AI Lyria requires a Google Cloud project with Vertex AI API enabled and authentication (ADC or service account).
"Silence is as powerful as sound. Restraint in audio design creates moments of profound impact." -- Fumito Ueda (ICO, Shadow of the Colossus)
"Music should mirror the emotional arc. The soundtrack IS the emotional journey." -- Jenova Chen (Journey)
| Need | Provider | Why |
|---|---|---|
| Character voice lines | ElevenLabs TTS | Natural speech, voice cloning for consistency |
| Sound effects | ElevenLabs SFX | Text-described SFX generation |
| Background music | ElevenLabs Music API | Prompt-driven, up to 5 min, vocals or instrumental |
| Background music (alt) | Vertex AI Lyria | 32.8s instrumental WAV, fixed duration |
| Ambient loops | ElevenLabs Music API or Lyria | ElevenLabs for flexible duration, Lyria for WAV output |
boilerplate/elevenlabs-client.ts for voice and SFX generationboilerplate/elevenlabs-music-client.ts for ElevenLabs music generation (preferred for most games)boilerplate/lyria-client.ts for music generationUse templates/sound-config.ts as a starting point. Define every game state that needs distinct audio (menu, exploration, combat, boss, social, idle). Map each state to track paths, volume levels, and crossfade durations.
Copy boilerplate/audio-manager.ts into your project. This provides:
Use the prompt templates from templates/prompt-catalog.md:
Lyria outputs WAV (32.8s, 48 kHz stereo). Convert for web:
# WAV to OGG (primary web format)
ffmpeg -i input.wav -c:a libvorbis -q:a 5 output.ogg
# WAV to MP3 (fallback)
ffmpeg -i input.wav -c:a libmp3lame -q:a 2 output.mp3
ElevenLabs outputs MP3 or OGG directly -- no conversion needed.
Subscribe your audio manager to game state changes. When the game enters combat, the audio manager crossfades to the combat track. When combat ends, it plays the victory stinger then fades back to exploration.
import { ElevenLabsClient } from './elevenlabs-client';
const client = new ElevenLabsClient(process.env.ELEVENLABS_API_KEY!);
// Generate NPC dialogue
const audioBuffer = await client.textToSpeech(
'Welcome, traveler. The road ahead is dangerous.',
{ voiceId: 'your-voice-id', model: 'eleven_multilingual_v2' },
);
await Bun.write('public/audio/voice/npc_greeting.mp3', audioBuffer);
const sfxBuffer = await client.generateSfx(
'sword clash, metallic impact, brief reverb',
{ duration: 2 },
);
await Bun.write('public/audio/sfx/sword_clash.mp3', sfxBuffer);
// Uses @elevenlabs/elevenlabs-js directly (not the wrapper in elevenlabs-client.ts)
import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js';
import { writeFileSync } from 'node:fs';
const client = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY });
// Basic generation
const audio = await client.music.compose({
prompt: 'Intense battle music, driving and urgent, 150 BPM, electric guitar riffs, pounding drums, brass stabs, instrumental only',
musicLengthMs: 60000,
});
const chunks: Buffer[] = [];
for await (const chunk of audio) {
chunks.push(Buffer.from(chunk));
}
writeFileSync('public/audio/music/combat_standard.mp3', Buffer.concat(chunks));
For granular control, generate a composition plan first:
// compositionPlan API may require a recent ElevenLabs SDK version; check docs if unavailable
const plan = await client.music.compositionPlan.create({
prompt: 'Intense battle music, 150 BPM, no vocals',
musicLengthMs: 60000,
});
// Inspect plan.positiveGlobalStyles, modify if needed
const audio = await client.music.compose({
compositionPlan: plan,
musicLengthMs: 60000,
});
import { LyriaClient } from './lyria-client';
const lyria = new LyriaClient({
projectId: process.env.GCP_PROJECT_ID!,
location: 'us-central1',
});
const tracks = await lyria.generate({
prompt: 'Intense battle music, driving and urgent, 150 BPM, electric guitar riffs, pounding drums, brass stabs',
negativePrompt: 'no vocals, no calm sections, no silence, no sound effects',
seed: 2001,
sampleCount: 2,
});
await lyria.saveAll(tracks, 'combat_standard', './output/music/combat');
import { AudioManager } from './audio-manager';
import { AUDIO_CONFIG } from './sound-config';
const audio = new AudioManager(AUDIO_CONFIG);
audio.unlockMobile();
// Game state changes drive audio automatically
audio.transition('menu'); // Plays menu theme
audio.transition('exploration'); // Crossfades to exploration + ambient
audio.transition('combat'); // Fast crossfade to combat music
audio.transition('boss'); // Switches to boss theme
audio.playSfx('sword_clash'); // One-shot SFX on top
audio.playVoice('npc_greeting'); // Voice line on top
instrumental only in your prompt. For Lyria, include no vocals, no sound effects as a negative prompt.Fumito Ueda (ICO, Shadow of the Colossus): Silence is as powerful as sound. Restraint in audio design creates moments of profound impact. When the music drops out during a key moment, the silence itself becomes the emotional beat. Do not fill every second with audio.
Jenova Chen (Journey): Music should mirror the emotional arc. The soundtrack IS the emotional journey. In Journey, the music builds with the player's progress, peaks at moments of connection, and recedes during solitude. Your adaptive music system should do the same -- the audio state machine is the tool that makes this possible.