Communitygithub.com

ElevenLabs TTS

使用本地语音配置文件从脚本或内联文本生成ElevenLabs文本转语音音频。当用户提及ElevenLabs、文本转语音、TTS、旁白、配音或语音生成时使用;仅从技能外部的本地配置加载语音名称、语音ID、邮箱、所有者及账户特定默认值。

ElevenLabs TTS 是什么?

该技能(ElevenLabs TTS)用于通过ElevenLabs API生成高质量的文本转语音音频。它提供了灵活的工作流,支持从文本脚本或内联文本输入中生成语音,并利用存储在技能外部的本地JSON配置文件来定义语音配置文件。技能的核心设计原则是可复用性和非个性化,明确禁止在技能本身存储API密钥、语音名称或账户默认值。用户必须通过环境变量`ELEVENLABS_API_KEY`提供API密钥,并通过本地配置文件(例如通过`--config`参数或`ELEVENLABS_TTS_CONFIG`环境变量指定)加载账户特定的语音设置。该技能包含一个帮助脚本(`scripts/generate_voice.py`),支持多种输入方式(文件、内联文本或标准输入)、配置文件选择、运行时参数覆盖(如语音ID、模型ID)以及预览模式(`--dry-run`)。输出音频文件默认放置在配置文件指定的目录(例如`outputs/voiceovers/`)或用户指定的路径。此技能通过确保敏感账户信息永不嵌入技能代码或提示中,增强了安全性和可移植性。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/MengTo/Skills/tree/HEAD/agent-skills/codex/elevenlabs-tts

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

ElevenLabs TTS 是做什么的?

使用此技能进行ElevenLabs文本转语音生成。保持技能可复用且非个性化:

  • 不要在技能中存储API密钥、语音名称、语音ID、邮箱、账户名称、客户名称或个人默认值。
  • 从进程环境变量或最近的 .env 文件中读取 ELEVENLABS_API_KEY。
  • 从本地JSON配置文件中读取账户特定的语音配置文件,该文件位于技能外部。
  • 使用请求级别的设置生成音频。除非用户明确要求,否则不要修改已保存的ElevenLabs账户或语音设置。

本地配置文件

按顺序优先选择以下配置文件源之一:

  1. --config /path/to/profiles.json
  2. ELEVENLABS_TTS_CONFIG=/path/to/profiles.json
  3. local/elevenlabs/profiles.json

项目本地的配置文件文件(如 config/local/elevenlabs-tts.json)在已加入gitignore的前提下也是可以的。

帮助脚本期望的格式如下:

{
  "default_profile": "default",
  "profiles": {
    "default": {
      "voice_name": "本地账户中的语音名称",
      "voice_id": "可选的直接语音ID",
      "voice_id_env": "OPTIONAL_ENV_VAR_WITH_VOICE_ID",
      "model_id": "eleven_multilingual_v2",
      "output_format": "mp3_44100_128",
      "voice_settings": {
        "stability": 0.5,
        "similarity_boost": 1.0,
        "style": 0.0,
        "speed": 1.0,
        "use_speaker_boost": true
      },
      "output_dir": "outputs/voiceovers",
      "emails": []
    }
  }
}

emails、所有者、别名和备注等字段仅适用于本地路由/上下文。脚本会忽略未知的元数据字段。

工作流程

  1. 从 --profile、ELEVENLABS_TTS_PROFILE 或 default_profile 中选择配置文件。
  2. 优先使用帮助脚本: python3 <skill-root>/scripts/generate_voice.py --text-file script.txt --profile default --output output.mp3
  3. 如果配置文件有 voice_id,则使用它。如果它有 voice_id_env,则读取该环境变量。否则通过 voice_name 搜索ElevenLabs。
  4. 使用配置文件中的 model_id、output_format 和 voice_settings,除非用户为本次生成覆盖了它们。
  5. 将生成的音频放到请求的目标位置。如果没有指定目标位置,则使用配置文件的 output_dir,然后是 outputs/voiceovers/。
  6. 报告输出路径和任何重要警告。不要打印机密信息。

帮助脚本

绑定的脚本支持:

  • --text "..." 用于内联文本
  • --text-file path.txt 用于脚本文件
  • 当未提供 --text 和 --text-file 时,从标准输入读取
  • --profile name 用于选择本地配置文件
  • --config path.json 用于选择本地配置文件文件
  • --voice-id、--voice-name、--model-id、--output-format 和 --settings-json 用于一次性覆盖
  • --output path.mp3 用于选择输出文件
  • --dry-run 用于打印解析后的请求负载而不调用文本转语音端点
  • --list-voices 用于列出匹配的ElevenLabs语音而不生成音频

API 说明

使用当前的ElevenLabs端点:

  • 语音搜索:GET https://api.elevenlabs.io/v2/voices
  • 语音生成:POST https://api.elevenlabs.io/v1/text-to-speech/:voice_id?output_format=...

将API密钥作为 xi-api-key 发送。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

MengTo/Skills

Create polished 60 fps 4:3 4K browser screen-recording style videos from Codex in-app browser captures, with browser-only crop, natural macOS cursor styling, deliberate click choreography, zoom-follow framing, ffprobe/thumbnail verification, and optional native recording compatibility checks. Use when the user asks to record or re-record browser actions, show cursor clicks and zooms, make Dribbble/UI inspiration or product demo recordings, or asks whether Codex, Playwright, or an MCP can produce a natural browser demo video.

MengTo/Skills

Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to make animations performant, pause offscreen animations, look for memory leaks, profile pages that slow the computer over time, fix janky scrolling, reduce CPU/GPU use, or repeat the "only play in view" optimization on React/Vite/Next/frontend pages using Codex Browser.

MengTo/Skills

Turn a reference video into a super detailed recreation or inspiration prompt. Use when the user provides, mentions, uploads, links, or points to a video and asks to analyze the design, UI, animations, transitions, scroll interactions, typography, colors, assets, WebGL/Three.js, storytelling, section-by-section behavior, or to create a prompt/article that recreates the page, app, interaction, or motion system.

MengTo/Skills

Create an on-scroll animation trigger using IntersectionObserver with Tailwind-friendly animation classes and keyframes. Use when asked for scroll-reveal, animate-on-scroll, or sequencing element animations when they enter the viewport.

MengTo/Skills

Use when designing or implementing product-grade web motion like Stripe, Linear, Apple, and Vercel. Covers motion principles, easing/duration defaults, choreography patterns, scroll/hover interactions, performance, accessibility (reduced motion), and implementation guidance.

MengTo/Skills

Create premium cinematic web motion systems with GSAP, ScrollTrigger, and Lenis. Use for luxury editorial websites, creative studio portfolios, Awwwards-style interactions, smooth scroll reveals, staggered text, parallax, pinned sections, magnetic hover states, custom cursors, and mouse-reactive layered movement.

MengTo/Skills

Create cinematic scroll-driven landing pages with Lenis smooth scrolling, GSAP ScrollTrigger, scroll-linked progression, staggered text reveals, sticky card stacks, parallax backgrounds, scroll-scrubbed transitions, footer reveals, and immersive preloaders. Use when analyzing or building premium editorial scroll experiences, sticky project stacks, kinetic typography, or section-by-section storytelling.

MengTo/Skills

Use when designing or rewriting a high-converting SaaS pricing page (structure, plan design, copywriting, SEO/AEO, FAQs, layout patterns, experiments). Includes checklists, templates, and common pitfalls.

MengTo/Skills

Use when creating or refining WebGL-heavy landing pages and you need to steer toward a specific visual outcome (premium, technical, playful, cinematic) while balancing conversion clarity, performance, and implementation complexity.

相关技能