网淘吧来吧,欢迎您!

返回首页 微信
微信
手机版
手机版

ElevenLabs Voices

2026-03-27 新闻来源:网淘吧 围观:23
电脑广告
手机广告

ElevenLabs语音角色库 v2.1

基于ElevenLabs API的综合性语音合成工具包

🚀 首次运行 - 设置向导

首次使用此功能时(若不存在config.json配置文件),请运行交互式设置向导:

python3 scripts/setup.py

向导将引导您完成:

  1. API密钥- 输入您的ElevenLabs API密钥(必需)
  2. 默认语音- 从热门语音中选择(Rachel、Adam、Bella等)
  3. 语言设置- 设置首选语言(支持32种语言)
  4. 音频质量- 标准或高质量输出
  5. 成本追踪- 启用用量与费用监控
  6. 预算限制- 可选的月度支出上限

🔒 隐私说明:您的API密钥将本地存储于config.json配置文件仅此而已。它永远不会离开您的机器,并通过.gitignore自动从git中排除。如需随时重新配置,只需再次运行设置向导。

✨ 功能特性


18种语音角色

  • - 为不同使用场景精心筛选的语音32种语言
  • - 采用多语言v2模型实现多语言合成流式传输模式
  • - 生成时实时输出音频音效(SFX)
  • - 通过文本提示生成AI音效批量处理
  • - 一次性处理多个文本成本追踪
  • - 监控字符使用量和预估成本语音设计
  • - 根据描述创建自定义语音发音词典
  • - 自定义词汇发音规则- Custom word pronunciation rules
  • OpenClaw 集成- 与 OpenClaw 的内置 TTS 协同工作

🎙 可用语音

语音口音性别人物设定最佳适用场景
rachel🇺🇸 美国女性温暖对话、教程
adam🇺🇸 美国男性旁白纪录片、有声读物
bella🇺🇸 美国女性专业商务、演示
brian🇺🇸 美国男性安慰冥想,平静满足
乔治🇬🇧 英国男性故事讲述者有声书,讲故事
爱丽丝🇬🇧 英国女性教育者教程,讲解
卡勒姆🇺🇸 美国男性捣蛋鬼玩乐,游戏
查理🇦🇺 澳大利亚男性精力充沛体育,激励
杰西卡🇺🇸 美国女性活泼有趣社交媒体,休闲
莉莉英国女性女演员戏剧,优雅内容
玛蒂尔达美国女性专业人士企业,新闻
里弗美国中性中性包容性,信息丰富
罗杰美国男性休闲播客,轻松
丹尼尔英国男性播音员新闻,公告
埃里克美国男性值得信赖的商业、企业
克里斯🇺🇸 美国男性友好的教程、平易近人
威尔🇺🇸 美国男性乐观主义者激励、鼓舞人心
利亚姆🇺🇸 美国男性社交型YouTube、社交媒体

🎯 快速预设

  • 默认→ 瑞秋(温暖,友好)
  • 旁白→ 亚当(纪录片)
  • 专业→ 玛蒂尔达(企业)
  • 讲故事者→ 乔治(有声书)
  • 教育者→ 爱丽丝(教程)
  • 冷静→ 布莱恩(冥想)
  • 精力充沛→ 利亚姆(社交媒体)
  • 值得信赖→ 埃里克(商业)
  • 中性→ 里弗(包容性)
  • 英式→ 乔治
  • 澳大利亚式→ 查理
  • 广播员→ 丹尼尔(新闻)

🌍 支持的语言(32种)

多语言v2模型支持以下语言:

代码语言代码语言
en英语pl波兰语
德语德语荷兰语荷兰语
西班牙语西班牙语瑞典语瑞典语
法语法语丹麦语丹麦语
意大利语意大利语芬兰语芬兰语
葡萄牙语葡萄牙语挪威语挪威语
俄语俄语土耳其语土耳其语
乌克兰语乌克兰语捷克语捷克语
日语日语sk斯洛伐克语
ko韩语hu匈牙利语
zh中文ro罗马尼亚语
ar阿拉伯语bg保加利亚语
hi印地语hr克罗地亚语
ta泰米尔语el希腊语
id印度尼西亚语ms马来语
vi越南语th泰语
# Synthesize in German
python3 tts.py --text "Guten Tag!" --voice rachel --lang de

# Synthesize in French
python3 tts.py --text "Bonjour le monde!" --voice adam --lang fr

# List all languages
python3 tts.py --languages

💻 命令行界面用法

基础文本转语音

# List all voices
python3 scripts/tts.py --list

# Generate speech
python3 scripts/tts.py --text "Hello world" --voice rachel --output hello.mp3

# Use a preset
python3 scripts/tts.py --text "Breaking news..." --voice broadcaster --output news.mp3

# Multi-language
python3 scripts/tts.py --text "Bonjour!" --voice rachel --lang fr --output french.mp3

流媒体模式

实时流式生成音频(适用于长文本):

# Stream audio as it generates
python3 scripts/tts.py --text "This is a long story..." --voice adam --stream

# Streaming with custom output
python3 scripts/tts.py --text "Chapter one..." --voice george --stream --output chapter1.mp3

批量处理

从文件处理多个文本:

# From newline-separated text file
python3 scripts/tts.py --batch texts.txt --voice rachel --output-dir ./audio

# From JSON file
python3 scripts/tts.py --batch batch.json --output-dir ./output

JSON批量格式:

[
  {"text": "First line", "voice": "rachel", "output": "line1.mp3"},
  {"text": "Second line", "voice": "adam", "output": "line2.mp3"},
  {"text": "Third line"}
]

简单文本格式(每行一个):

Hello, this is the first sentence.
This is the second sentence.
And this is the third.

使用统计

# Show usage stats and cost estimates
python3 scripts/tts.py --stats

# Reset statistics
python3 scripts/tts.py --reset-stats

🎵 音效

根据文本描述生成AI驱动的音效:

# Generate a sound effect
python3 scripts/sfx.py --prompt "Thunder rumbling in the distance"

# With specific duration (0.5-22 seconds)
python3 scripts/sfx.py --prompt "Cat meowing" --duration 3 --output cat.mp3

# Adjust prompt influence (0.0-1.0)
python3 scripts/sfx.py --prompt "Footsteps on gravel" --influence 0.5

# Batch SFX generation
python3 scripts/sfx.py --batch sounds.json --output-dir ./sfx

# Show prompt examples
python3 scripts/sfx.py --examples

示例提示:

  • “远处雷声隆隆”
  • “猫满足地发出呼噜声”
  • “在机械键盘上打字”
  • “宇宙飞船引擎嗡嗡作响”
  • “咖啡店背景聊天声”

🎨 语音设计

根据文本描述创建自定义语音:

# Basic voice design
python3 scripts/voice-design.py --gender female --age middle_aged --accent american \
  --description "A warm, motherly voice"

# With custom preview text
python3 scripts/voice-design.py --gender male --age young --accent british \
  --text "Welcome to the adventure!" --output preview.mp3

# Save to your ElevenLabs library
python3 scripts/voice-design.py --gender female --age young --accent american \
  --description "Energetic podcast host" --save "MyHost"

# List all design options
python3 scripts/voice-design.py --options

语音设计选项:

选项数值
性别男性、女性、中性
年龄年轻、中年、老年
口音美式、英式、非洲、澳大利亚、印度、拉丁、中东、斯堪的纳维亚、东欧
口音强度0.3-2.0(轻微到强烈)

📖 发音词典

自定义单词发音:

编辑pronunciations.json

{
  "rules": [
    {
      "word": "OpenClaw",
      "replacement": "Open Claw",
      "comment": "Pronounce as two words"
    },
    {
      "word": "API",
      "replacement": "A P I",
      "comment": "Spell out acronym"
    }
  ]
}

用法:

# Pronunciations are applied automatically
python3 scripts/tts.py --text "The OpenClaw API is great" --voice rachel

# Disable pronunciations
python3 scripts/tts.py --text "The API is great" --voice rachel --no-pronunciations

💰 成本追踪

该技能追踪您的字符使用量并估算成本:

python3 scripts/tts.py --stats

输出:

📊 ElevenLabs Usage Statistics

  Total Characters: 15,230
  Total Requests:   42
  Since:            2024-01-15

💰 Estimated Costs:
  Starter    $4.57 ($0.30/1k chars)
  Creator    $3.66 ($0.24/1k chars)
  Pro        $2.74 ($0.18/1k chars)
  Scale      $1.68 ($0.11/1k chars)

🤖 OpenClaw TTS 集成

与 OpenClaw 内置 TTS 配合使用

OpenClaw 内置了支持使用 ElevenLabs 的 TTS 功能。请在以下文件中配置:~/.openclaw/openclaw.json在聊天中触发TTS

{
  "tts": {
    "enabled": true,
    "provider": "elevenlabs",
    "elevenlabs": {
      "apiKey": "your-api-key-here",
      "voice": "rachel",
      "model": "eleven_multilingual_v2"
    }
  }
}

在OpenClaw对话中:

使用

  • /tts on以启用自动文本转语音直接使用
  • tts工具进行一次性语音合成请求“朗读这个”或“说出这个”
  • 使用OpenClaw中的技能脚本

⚙ 配置

# OpenClaw can run these scripts directly
exec python3 /path/to/skills/elevenlabs-voices/scripts/tts.py --text "Hello" --voice rachel

脚本按以下顺序查找API密钥:

ELEVEN_API_KEY

  1. ELEVENLABS_API_KEY环境变量技能本地
  2. .env文件(位于技能目录中)创建.env文件:

注意:

echo 'ELEVEN_API_KEY=your-key-here' > .env

该技能不再从~/.openclaw/openclaw.json读取~/.openclaw/openclaw.json. 使用环境变量或技能本地.env文件。


🎛 语音设置

每个语音都已针对最佳输出进行了调校设置:

设置范围描述
稳定性0.0-1.0值越高越稳定一致,值越低越富有表现力
相似度增强0.0-1.0与原始语音的匹配接近程度
风格0.0-1.0说话风格的夸张程度

📝 触发词

  • "使用 {voice_name} 语音"
  • "以 {persona} 的身份说话"
  • "列出语音"
  • "语音设置"
  • "生成音效"
  • "设计一个语音"

📁 文件

elevenlabs-voices/
├── SKILL.md              # This documentation
├── README.md             # Quick start guide
├── config.json           # Your local config (created by setup, in .gitignore)
├── voices.json           # Voice definitions & settings
├── pronunciations.json   # Custom pronunciation rules
├── examples.md           # Detailed usage examples
├── scripts/
│   ├── setup.py          # Interactive setup wizard
│   ├── tts.py            # Main TTS script
│   ├── sfx.py            # Sound effects generator
│   └── voice-design.py   # Voice design tool
└── references/
    └── voice-guide.md    # Voice selection guide

🔗 链接


📋 更新日志

v2.1.0

  • 新增交互式设置向导 (scripts/setup.py)
  • 引导用户完成 API 密钥、语音、语言、质量和预算设置
  • 配置本地存储在config.json(已添加到.gitignore)
  • 专业、注重隐私的设置体验

v2.0.0

  • 通过--lang参数新增 32 种语言支持
  • 新增流式模式,--stream标志
  • 新增音效生成 (sfx.py)
  • 新增使用--batch标志的批处理功能
  • 新增使用--stats标志的成本跟踪功能
  • 新增语音设计工具 (voice-design.py)
  • 新增发音词典支持
  • 新增 OpenClaw TTS 集成文档
  • 改进了错误处理和进度输出
免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第291796名访客 今日有273篇新文章/评论