ElevenLabs:AI 语音、音效和音乐生成 - Openclaw Skills

作者:互联网

2026-04-15

AI教程

什么是 ElevenLabs?

用于 Openclaw Skills 的 ElevenLabs 技能为您的工作流程带来了专业级的 AI 音频合成。它提供了与 ElevenLabs API 的桥梁,允许进行高保真文本转语音,并能对语音特性(如稳定性和相似度)进行细粒度控制。

除了简单的演讲,该技能还支持生成独特的音效和完整的器乐曲目。它是为需要将动态音频资产集成到项目中,同时保持对语音克隆和 API 配额管理严格控制的开发者而设计的。

下载入口:https://github.com/openclaw/skills/tree/main/skills/odrobnik/elevenlabs-skill

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install elevenlabs-skill

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 elevenlabs-skill。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

ElevenLabs 应用场景

  • 为营销视频和教程生成逼真的配音。
  • 为沉浸式应用程序 UI/UX 创建定制音效。
  • 为演示文稿或社交媒体内容创作背景音乐。
  • 克隆特定语音以在媒体中保持一致的品牌标识。
  • 为 AI 驱动的内容平台自动化音频生产流程。
ElevenLabs 工作原理
  1. 该技能利用专门的 Python 脚本处理不同的音频任务,如语音、音乐或克隆。
  2. 发出的命令带有语音 ID、文本提示或源音频文件路径等参数。
  3. 系统使用 ELEVENLABS_API_KEY 与 ElevenLabs 服务器通信。
  4. 音频根据选定的模型和配置设置生成。
  5. 输出以用户首选的音频格式交付并保存到本地文件系统。

ElevenLabs 配置指南

要在 Openclaw Skills 中开始使用此技能,您必须提供您的 API 凭据。

# 在您的环境中设置 API 密钥
export ELEVENLABS_API_KEY='your_elevenlabs_api_key'

# 确保已安装 Python 3
python3 --version

ElevenLabs 数据架构与分类体系

该技能生成并管理各种格式的音频数据。以下是支持输出的明细:

格式 应用
MP3 标准高质量音频 (128kbps/192kbps)
PCM 用于专门处理的原始音频数据 (16kHz - 44.1kHz)
u-law 电话兼容音频 (8kHz)

语音元数据包括名称、ID、性别和语言标签,而配额数据跟踪字符使用情况和计划限制。

name: elevenlabs
description: Text-to-speech, sound effects, music generation, voice management, and quota checks via the ElevenLabs API. Use when generating audio with ElevenLabs or managing voices.
metadata: {"clawdbot":{"requires":{"bins":["python3"],"env":["ELEVENLABS_API_KEY"]},"primaryEnv":"ELEVENLABS_API_KEY"}}

ElevenLabs Skill

Core tools for interacting with the ElevenLabs API for sound generation, music, and voice management.

Setup

Requires ELEVENLABS_API_KEY in environment.

Output Formats

All scripts support multiple output formats via --format:

Format Description
mp3_44100_128 MP3, 44.1kHz, 128kbps (default)
mp3_44100_192 MP3, 44.1kHz, 192kbps
pcm_16000 Raw PCM, 16kHz
pcm_22050 Raw PCM, 22.05kHz
pcm_24000 Raw PCM, 24kHz
pcm_44100 Raw PCM, 44.1kHz
ulaw_8000 μ-law, 8kHz (telephony)

Tools

1. Speech (speech.py)

Text-to-speech using ElevenLabs voices.

# Basic usage
python3 {baseDir}/scripts/speech.py "Hello world" -v  -o output.mp3

# With format option
python3 {baseDir}/scripts/speech.py "Hello world" -v  -o output.pcm --format pcm_44100

# With voice settings
python3 {baseDir}/scripts/speech.py "Hello" -v  -o out.mp3 --stability 0.7 --similarity 0.8

2. Sound Effects (sfx.py)

Generate sound effects and short audio clips.

# Generate a sound
python3 {baseDir}/scripts/sfx.py "Cinematic boom" -o boom.mp3

# Generate a loop
python3 {baseDir}/scripts/sfx.py "Lo-fi hip hop beat" --duration 10 --loop -o beat.mp3

# Different format
python3 {baseDir}/scripts/sfx.py "Whoosh" -o whoosh.pcm --format pcm_44100

3. Music Generation (music.py)

Generate full musical compositions or instrumental tracks.

# Generate instrumental intro
python3 {baseDir}/scripts/music.py --prompt "Upbeat 6s news intro sting, instrumental" --length-ms 6000 -o intro.mp3

# Generate background bed
python3 {baseDir}/scripts/music.py --prompt "Soft ambient synth pad" --length-ms 30000 -o bed.mp3

# High quality MP3
python3 {baseDir}/scripts/music.py --prompt "Jazz piano" --length-ms 10000 -o jazz.mp3 --output-format mp3_44100_192

4. Voices (voices.py)

List available voices and their IDs.

# List voices
python3 {baseDir}/scripts/voices.py

# JSON output
python3 {baseDir}/scripts/voices.py --json

5. Voice Cloning (voiceclone.py)

Create instant voice clones from audio samples.

# Clone from audio files
python3 {baseDir}/scripts/voiceclone.py --name "MyVoice" --files sample1.mp3 sample2.mp3

# With language and gender labels
python3 {baseDir}/scripts/voiceclone.py --name "Andi" --files *.m4a --language de --gender male

# With description and noise removal
python3 {baseDir}/scripts/voiceclone.py --name "Andi" --files *.m4a --description "German male" --denoise

6. Quota & Usage (quota.py)

Check subscription quota and usage statistics.

# Show current quota
python3 {baseDir}/scripts/quota.py

# Include usage breakdown by voice
python3 {baseDir}/scripts/quota.py --usage

# Last 7 days usage
python3 {baseDir}/scripts/quota.py --usage --days 7

# JSON output
python3 {baseDir}/scripts/quota.py --json

Output: ``` ?? ElevenLabs Quota

Plan: pro (active) — annual Characters: 66.6K / 500.0K (13.3%) [███???????????????????????????] Resets: 2026-02-18 (29 days) Voices: 22 / 160 (IVC: ?) Pro Voice: 0 / 1 (PVC: ?)