Communitygithub.com

ElevenLabs TTS 技能

使用本地語音設定檔,從腳本或內嵌文字產生 ElevenLabs 文字轉語音音訊。當使用者要求 ElevenLabs、文字轉語音、TTS、旁白、配音、語音音訊或語音生成時使用;僅從技能外部的本地設定載入語音名稱、語音 ID、電子郵件、擁有者及帳戶特定預設值。

ElevenLabs TTS 技能 是什麼?

此技能提供了一個可重複使用的工具,用於透過 ElevenLabs API 產生高品質的文字轉語音 (TTS) 音訊。它透過從技能外部的本機 JSON 設定檔讀取帳戶特定的語音設定檔,來強制分離個人帳戶設定與可重複使用的技能邏輯。這可防止 API 金鑰、語音名稱和使用者詳細資料意外暴露在版本控制的程式碼庫中。此技能支援從常見的開發工具環境(如 Claude Code、Cursor 和 Codex)中使用,並可透過命令列引數或環境變數 (`ELEVENLABS_API_KEY`、`ELEVENLABS_TTS_CONFIG`) 來設定。其核心工作流程涉及選擇一個預先定義的語音設定檔,該設定檔包含語音 ID、模型選擇和輸出格式等設定,然後使用一個輔助 Python 腳本 (`generate_voice.py`) 來處理文字輸入並產生音訊檔案。該腳本支援內嵌文字、文字檔案、標準輸入、一次性的覆寫設定(如語音 ID 或模型),以及用於除錯的測試模式 (`--dry-run`)。產生的音訊會放置在請求的目的地或設定檔指定的目錄中,並向使用者報告結果路徑及任何相關的警告。

相容平台~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 name from the local account",
      "voice_id": "optional-direct-voice-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.

相關技能