Agent Skillsbenchflow-ai/skillsbench › elevenlabs-tts

elevenlabs-tts

GitHub

利用ElevenLabs API将文本转换为高质量语音。支持指定音色、调整声音设置,并处理长文本分块生成与合并,适用于语音合成场景。

tasks-extra/pg-essay-to-audiobook/environment/skills/elevenlabs-tts/SKILL.md benchflow-ai/skillsbench

Trigger Scenarios

需要将文本转换为音频 请求使用ElevenLabs服务生成语音

Install

npx skills add benchflow-ai/skillsbench --skill elevenlabs-tts -g -y
More Options

Non-standard path

npx skills add https://github.com/benchflow-ai/skillsbench/tree/main/tasks-extra/pg-essay-to-audiobook/environment/skills/elevenlabs-tts -g -y

Use without installing

npx skills use benchflow-ai/skillsbench@elevenlabs-tts

指定 Agent (Claude Code)

npx skills add benchflow-ai/skillsbench --skill elevenlabs-tts -a claude-code -g -y

安装 repo 全部 skill

npx skills add benchflow-ai/skillsbench --all -g -y

预览 repo 内 skill

npx skills add benchflow-ai/skillsbench --list

SKILL.md

Frontmatter
{
    "name": "elevenlabs-tts",
    "description": "ElevenLabs Text-to-Speech API for high-quality speech synthesis."
}

ElevenLabs Text-to-Speech

Generate high-quality speech audio from text using the ElevenLabs API.

Authentication

The API key is available as environment variable:

ELEVENLABS_API_KEY

Include in request header:

xi-api-key: $ELEVENLABS_API_KEY

API Endpoints

Text-to-Speech

POST https://api.elevenlabs.io/v1/text-to-speech/{voice_id}

Request Body:

{
  "text": "Your text here",
  "model_id": "eleven_turbo_v2_5",
  "voice_settings": {
    "stability": 0.5,
    "similarity_boost": 0.5
  }
}

Response: Audio bytes (mp3 format by default)

Popular Voice IDs

  • 21m00Tcm4TlvDq8ikWAM - Rachel (female, calm)
  • EXAVITQu4vr4xnSDxMaL - Bella (female, soft)
  • ErXwobaYiN019PkySvjV - Antoni (male, warm)
  • TxGEqnHWrfWFTfGW9XjX - Josh (male, deep)

Python Example

import os
import requests

ELEVENLABS_API_KEY = os.environ.get("ELEVENLABS_API_KEY")
VOICE_ID = "21m00Tcm4TlvDq8ikWAM"  # Rachel

def text_to_speech(text, output_path):
    url = f"https://api.elevenlabs.io/v1/text-to-speech/{VOICE_ID}"

    headers = {
        "xi-api-key": ELEVENLABS_API_KEY,
        "Content-Type": "application/json"
    }

    data = {
        "text": text,
        "model_id": "eleven_turbo_v2_5",
        "voice_settings": {
            "stability": 0.5,
            "similarity_boost": 0.75
        }
    }

    response = requests.post(url, json=data, headers=headers)

    if response.status_code == 200:
        with open(output_path, "wb") as f:
            f.write(response.content)
        return True
    else:
        print(f"Error: {response.status_code} - {response.text}")
        return False

Handling Long Text

ElevenLabs has a ~5000 character limit per request. For long documents:

  1. Split text into chunks at sentence boundaries
  2. Generate audio for each chunk
  3. Concatenate using ffmpeg or pydub:
# Create file list
echo "file 'chunk1.mp3'" > files.txt
echo "file 'chunk2.mp3'" >> files.txt

# Concatenate
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp3

Best Practices

  • Split at sentence boundaries to avoid cutting words
  • Check rate limits (varies by subscription tier)
  • Cache generated audio to avoid redundant API calls

Version History

  • 9a1f4dd Current 2026-07-24 16:37

Same Skill Collection

.agents/skills/skill-creator/SKILL.md
.agents/skills/skillsbench/SKILL.md
.agents/skills/task-creator/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/ebcdic-overpunch-decoding/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gl-posting-codes/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pdf/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/rdkit/SKILL.md
tasks-extra/gh-repo-analytics/environment/skills/gh-cli/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/multi-resource-allocation-validation/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/online-resource-scheduling/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/mhc-algorithm/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/nanogpt-training/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/nda-clause-taxonomy/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/xlsx-parsing/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-count-in-video/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-video-understanding/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gpt-multimodal/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/video-frame-extraction/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/audiobook/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/gtts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/openai-tts/SKILL.md
tasks-extra/scheduling-email-assistant/environment/skills/gmail-skill/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/automatic-speech-recognition/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/multimodal-fusion/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/speaker-clustering/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/voice-activity-detection/SKILL.md
tasks-extra/taxonomy-tree-merge/environment/skills/hierarchical-taxonomy-clustering/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/ffmpeg-video-editing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/filler-word-processing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/whisper-transcription/SKILL.md
tasks-extra/video-tutorial-indexer/environment/skills/speech-to-text/SKILL.md
tasks/3d-scan-calc/environment/skills/mesh-analysis/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/ada-plan-view-accessibility/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/architectural-dxf-extraction/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/geometric-layout-repair/SKILL.md
tasks/adaptive-cruise-control/environment/skills/csv-processing/SKILL.md
tasks/adaptive-cruise-control/environment/skills/pid-controller/SKILL.md
tasks/adaptive-cruise-control/environment/skills/simulation-metrics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/vehicle-dynamics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/yaml-config/SKILL.md
tasks/azure-bgp-oscillation-route-leak/environment/skills/azure-bgp/SKILL.md
tasks/bike-rebalance/environment/skills/geospatial-routing-data/SKILL.md

Metadata

Files
0
Version
9a1f4dd
Hash
b06eb58a
Indexed
2026-07-24 16:37

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-08 18:56
浙ICP备14020137号-1 $방문자$