elevenlabs-tts
Convert text to speech, narrate, voiceover. 32 languages, 22+ voices. Use for: TTS, audio
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Convert text to speech, narrate, voiceover. 32 languages, 22+ voices. Use for: TTS, audio
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create multi-speaker dialogue audio. Use for: podcasts, conversations, audiobook scenes
Translate and dub audio/video to another language. Use for: localization, multilingual
Generate music from text description. Use for: background music, jingles, soundtracks
Generate sound effects from description. Use for: SFX, game audio, video soundscape
Transcribe audio to text, speech recognition. Use for: transcription, subtitles, dictation
Change voice in audio file to another voice. Use for: voice swap, dubbing, anonymization
| name | elevenlabs-tts |
| description | Convert text to speech, narrate, voiceover. 32 languages, 22+ voices. Use for: TTS, audio |
| allowed-tools | Bash(curl *) |
| disable-model-invocation | true |
Generate speech audio from text using the ElevenLabs API.
Ask the user for:
Available voices:
| Name | Voice ID | Accent | Gender |
|---|---|---|---|
| George (default) | JBFqnCBsd6RMkjVDRZzb | British | Male |
| Rachel | 21m00Tcm4TlvDq8ikWAM | American | Female |
| Aria | 9BWtsMINqrJLrRacOk9x | American | Female |
| Charlie | IKne3meq5aSn9XLyUdCD | Australian | Male |
Then run the following steps:
Step 1 — Check API key:
if [ -z "$ELEVENLABS_API_KEY" ]; then
echo "ERROR: ELEVENLABS_API_KEY not set."
echo "Run /pocket-knife:setup to configure your API keys."
exit 1
fi
Step 2 — Set voice ID:
VOICE_INPUT="[VOICE_NAME_OR_ID_HERE]"
case "$VOICE_INPUT" in
george|"") VOICE_ID="JBFqnCBsd6RMkjVDRZzb" ;;
rachel) VOICE_ID="21m00Tcm4TlvDq8ikWAM" ;;
aria) VOICE_ID="9BWtsMINqrJLrRacOk9x" ;;
charlie) VOICE_ID="IKne3meq5aSn9XLyUdCD" ;;
*) VOICE_ID="$VOICE_INPUT" ;; # Assume custom voice ID was passed directly
esac
OUTPUT_FILE="${OUTPUT_FILE:-$HOME/Downloads/tts_$(date +%Y%m%d_%H%M%S).mp3}"
TEXT="[USER_TEXT_HERE]"
Step 3 — Generate audio:
# Use -f (not --fail-with-body) for binary output — mixing error body with binary stream corrupts the file
curl -f -s \
-X POST "https://api.elevenlabs.io/v1/text-to-speech/${VOICE_ID}" \
-H "xi-api-key: $ELEVENLABS_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"text\": \"$TEXT\", \"model_id\": \"eleven_multilingual_v2\", \"voice_settings\": {\"stability\": 0.5, \"similarity_boost\": 0.75}}" \
--output "$OUTPUT_FILE"
if [ $? -ne 0 ]; then
echo "ERROR: ElevenLabs API call failed."
echo "Check that ELEVENLABS_API_KEY is correct in ~/.claude/.env"
echo "Run /pocket-knife:setup to reconfigure."
exit 1
fi
# Verify the output file has content (empty file = API error without exit code)
if [ ! -s "$OUTPUT_FILE" ]; then
echo "ERROR: Audio file is empty. Possible causes:"
echo " - Invalid or empty text input"
echo " - Invalid voice ID: $VOICE_ID"
echo " - API returned error without proper HTTP status code"
rm -f "$OUTPUT_FILE"
exit 1
fi
echo "Audio generated successfully: $OUTPUT_FILE"
Report to the user: