in-app-audio

Installation
SKILL.md

In-App Audio Generation (ElevenLabs)

This skill provides guidelines and a generalized Python script to generate high-quality sound effects for game development and UI interactions (clicks, hovers, win states, errors, notifications, etc.) using the ElevenLabs Sound Effects API.

Best Practices for UI / Game Prompt Engineering

When crafting prompts for ElevenLabs, keep the following rules in mind:

  1. Describe the Physical World: Give context (e.g., "digital", "mechanical", "8-bit", "natural", "abstract"). This shapes the texture.
  2. Utilize Audio Descriptive Adjectives: Use audio terminology like "warm", "crisp but gentle transient", "clean attack", "no harsh highs", "low-mid pitch".
  3. Set the Emotional/Functional Context: Tell the AI what the sound is for (e.g., "playful game aesthetic", "functional UI error rejection", "bouncy confirm sound").
  4. Target Short Durations: For UI sounds, a duration of 0.5 to 2.0 seconds is ideal. Let it generate just enough to hit cleanly without a massive tail.
  5. Prompt Influence: Use a lower prompt influence (0.3 to 0.5) for Sound Effects rather than voices. This allows the model creative leeway to synthesize rather than overly strictly failing to map the prompt to real physics.

Examples of Great UI Prompts

  • Menu Confirmation: "bright, bouncy confirm sound with a soft plucky transient, cheerful upward tone, light cartoon-like sparkle, playful game aesthetic, clean attack, no harsh highs"
  • Error / Invalid: "short beep with low-mid pitch, muted mechanical tone, crisp but gentle transient, slight downward interval to signal rejection, no reverb, functional UI aesthetic"
  • Notification / Hover: "gentle two-tone chime with warm digital bell texture, smooth attack, ideal for menu transitions"
  • Win / Achievement: "triumphant ascending fanfare, bright brass stab with sparkle, short celebratory jingle, clean and punchy"
  • Countdown Tick: "clean digital metronome tick, sharp transient, no reverb, minimal decay, neutral pitch"

Short Musical Accompaniment & Loops

The ElevenLabs Sound Effects API (specifically the V2 model) is also highly capable of generating short instrumental loops and musical snippets to serve as background ambience or menu themes. You do not need the full Music API for this.

  1. Specify Genre and Tempo: Begin your prompt with clear musical direction. (e.g., "90s hip-hop drum loop, 90 BPM" or "Ambient synth pad").
  2. Detail the Instrumentation: List the key instruments and their tone. (e.g., "Vintage brass stabs in F minor" or "subtle modulation").
  3. Looping: The API supports generating seamless loops. When requesting a loop, explicitly use the word "loop" in your prompt to encourage a cyclical structure (e.g., "Playful, upbeat, slightly jazzy carnival instrumental loop, lighthearted").
  4. Duration: Background loops are typically longer than UI sounds. Target 10.0 to 30.0 seconds to give the track enough room to breathe before it repeats.
  5. No Vocals: Always specify "instrumental" or "no vocals" in the prompt for accompaniment. Ensure there are absolutely no vocal tracks generated unless explicitly requested by the design specification.

Batch Generation: Full UI Sound Kit

When building a complete set of UI sounds for an app, generate them in a single session using a consistent prompt template. This ensures tonal consistency across all sounds.

Template: "[ADJECTIVE] [SOUND TYPE], [TEXTURE/MATERIAL], [DURATION HINT], [AESTHETIC], clean attack, no reverb"

Example batch:

ui_click:     "crisp, short tap click, wooden texture, snappy transient, minimal UI aesthetic"
ui_hover:     "soft, gentle hover whoosh, airy digital texture, subtle and brief, minimal UI aesthetic"
ui_confirm:   "bright, bouncy confirm chime, plucky transient, cheerful upward tone, minimal UI aesthetic"
ui_cancel:    "muted, short cancel tone, low-mid pitch, slight downward interval, minimal UI aesthetic"
ui_error:     "dull, brief error buzz, muted mechanical tone, crisp rejection, minimal UI aesthetic"
ui_success:   "warm, ascending success chime, bell-like texture, two notes upward, minimal UI aesthetic"
ui_notify:    "gentle, two-tone notification, warm digital bell, smooth attack, minimal UI aesthetic"
ui_toggle:    "quick, subtle toggle switch, light mechanical snap, clean and dry, minimal UI aesthetic"

Using the Generation Script

This skill includes a generalized Python script that interacts with the API automatically.

Script Path: <path-to-skill>/scripts/generate_audio.py

Usage Instructions

python <path-to-skill>/scripts/generate_audio.py \
  --prompt "crisp ui click, short, wooden texture" \
  --name "ui_click" \
  --out_dir "./public/audio" \
  --format mp3

Arguments:

  • --prompt (Required): The vivid description of the sound effect.
  • --name (Required): The output filename without extension (e.g., ui_click).
  • --out_dir (Optional): The directory to save to. Defaults to ./public/audio.
  • --format (Optional): Output format — mp3, wav, or ogg. Defaults to mp3.
  • --duration (Optional): Exact duration in seconds. Defaults to 1.5.
  • --influence (Optional): Prompt influence scale between 0.0 and 1.0. Defaults to 0.4.
  • --api-key (Optional): Directly pass the ElevenLabs API Key. If omitted, the script reads from .env.local or environment variable ELEVENLABS_API_KEY.
Related skills

More from horace4444/extend-my-claude-code

Installs
1
First Seen
Mar 29, 2026