sound-effects
Original:🇺🇸 English
Not Translated
Generate sound effects from text descriptions using ElevenLabs. Use when creating sound effects, generating audio textures, producing ambient sounds, cinematic impacts, UI sounds, or any audio that isn't speech. Supports looping, duration control, and prompt influence tuning.
2installs
Sourceconnorads/dotfiles
Added on
NPX Install
npx skill4agent add connorads/dotfiles sound-effectsSKILL.md Content
ElevenLabs Sound Effects
Generate sound effects from text descriptions — supports looping, custom duration, and prompt adherence control.
Setup: See Installation Guide. For JavaScript, usepackages only.@elevenlabs/*
Quick Start
Python
python
from elevenlabs import ElevenLabs
client = ElevenLabs()
audio = client.text_to_sound_effects.convert(
text="Thunder rumbling in the distance with light rain",
)
with open("thunder.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)JavaScript
javascript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
const client = new ElevenLabsClient();
const audio = await client.textToSoundEffects.convert({
text: "Thunder rumbling in the distance with light rain",
});
audio.pipe(createWriteStream("thunder.mp3"));cURL
bash
curl -X POST "https://api.elevenlabs.io/v1/sound-generation" \
-H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
-d '{"text": "Thunder rumbling in the distance with light rain"}' \
--output thunder.mp3Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| string (required) | — | Description of the desired sound effect |
| string | | Model to use |
| number | null | null (auto) | Duration 0.5–30s; auto-calculated if null |
| number | null | 0.3 | How closely to follow the prompt (0–1) |
| boolean | false | Generate a seamlessly looping sound (v2 model only) |
Examples with Parameters
python
# Looping ambient sound, 10 seconds
audio = client.text_to_sound_effects.convert(
text="Gentle forest ambiance with birds chirping",
duration_seconds=10.0,
prompt_influence=0.5,
loop=True,
)
# Short UI sound, high prompt adherence
audio = client.text_to_sound_effects.convert(
text="Soft notification chime",
duration_seconds=1.0,
prompt_influence=0.8,
)Output Formats
Pass as a query parameter (cURL) or SDK parameter:
output_format| Format | Description |
|---|---|
| MP3 44.1kHz 128kbps (default) |
| Raw uncompressed CD quality |
| Opus 48kHz 128kbps — efficient compressed |
| μ-law 8kHz — telephony |
Full list: , , , , , , , , , , , , , , , , , , , , .
mp3_22050_32mp3_24000_48mp3_44100_32mp3_44100_64mp3_44100_96mp3_44100_128mp3_44100_192pcm_8000pcm_16000pcm_22050pcm_24000pcm_32000pcm_44100pcm_48000ulaw_8000alaw_8000opus_48000_32opus_48000_64opus_48000_96opus_48000_128opus_48000_192Prompt Tips
- Be specific: "Heavy rain on a tin roof" > "Rain"
- Combine elements: "Footsteps on gravel with distant traffic"
- Specify style: "Cinematic braam, horror" or "8-bit retro jump sound"
- Mention mood/context: "Eerie wind howling through an abandoned building"
Error Handling
python
try:
audio = client.text_to_sound_effects.convert(text="Explosion")
except Exception as e:
print(f"API error: {e}")Common errors:
- 401: Invalid API key
- 422: Invalid parameters (check duration range, prompt_influence range)
- 429: Rate limit exceeded
References
- Installation Guide