elevenlabs-tts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseElevenLabs Text-to-Speech
ElevenLabs 文本转语音
Generate high-quality speech from text using ElevenLabs API.
使用ElevenLabs API从文本生成高质量语音。
Quick Start
快速开始
bash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "Hello there" /tmp/output.mp3bash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "Hello there" /tmp/output.mp3Usage
使用方法
Basic TTS
基础文本转语音
bash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "<text>" <output_file>bash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "<text>" <output_file>With Voice Selection
选择语音
bash
job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "<text>" <output_file> <voice_id>bash
job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "<text>" <output_file> <voice_id>List Available Voices
列出可用语音
bash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js --list-voicesbash
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js --list-voicesConfiguration
配置
Requires environment variable:
- - ElevenLabs API key
ELEVENLABS_API_KEY
需要设置环境变量:
- - ElevenLabs API密钥
ELEVENLABS_API_KEY
Available Voices
可用语音
Default voices (get IDs with --list-voices):
- - Calm, professional female
rachel - - Conversational male
drew - - Authoritative male
clive - - Soft female
bella - - Versatile male
antoni - - Energetic male
charlie
默认语音(使用--list-voices获取ID):
- - 沉稳专业的女声
rachel - - 口语化男声
drew - - 权威感男声
clive - - 柔和女声
bella - - 多风格男声
antoni - - 活力男声
charlie
SSML Support
SSML支持
Use SSML for advanced control:
xml
<speak>
<break time="1s"/>
Hello there!
<break time="500ms"/>
How can I help you?
</speak>使用SSML实现高级控制:
xml
<speak>
<break time="1s"/>
Hello there!
<break time="500ms"/>
How can I help you?
</speak>Output Format
输出格式
Creates MP3 file at specified path. Returns path on success.
在指定路径生成MP3文件。成功时返回文件路径。
Examples
示例
bash
undefinedbash
undefinedGenerate speech with default voice
使用默认语音生成语音
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "Welcome to our service" /tmp/welcome.mp3
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "Welcome to our service" /tmp/welcome.mp3
Generate with specific voice
使用指定语音生成
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "This is important" /tmp/alert.mp3 EXAVITQu4vr4xnSDxMaL
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js "This is important" /tmp/alert.mp3 EXAVITQu4vr4xnSDxMaL
List all available voices
列出所有可用语音
/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js --list-voices
undefined/job/.pi/skills/elevenlabs-tts/elevenlabs-tts.js --list-voices
undefinedTips
提示
- Keep text under 5000 characters per request
- Use breaks and pauses for natural speech
- Preview with short clips before generating long audio
- For emotional delivery, use voice-specific prompts in the text
- 每个请求的文本长度控制在5000字符以内
- 使用停顿让语音更自然
- 生成长音频前先用短片段预览
- 如需带情感的语音,可在文本中加入适合该语音的提示词
When to Use
适用场景
- User requests voice message or audio narration
- Creating accessibility audio content
- Generating voice responses for chatbots
- Text-to-speech for notifications
- 用户请求语音消息或音频旁白
- 创建无障碍音频内容
- 为聊天机器人生成语音回复
- 为通知生成文本转语音内容