Communitygithub.com

sag - ElevenLabs TTS 與本地播放

使用 `sag` CLI 將文字轉為語音,並支援本地播放。

sag - ElevenLabs TTS 與本地播放 是什麼?

`sag` 是一個基於 ElevenLabs TTS 的指令列工具,能讓開發者與 AI 代理輕鬆將文字轉為高品質語音,並直接在本地播放。它支援多種模型(如 expressive 的 `eleven_v3`、穩定的 `eleven_multilingual_v2` 和快速的 `eleven_flash_v2_5`),並提供豐富的發音與語氣控制功能,包括重新拼寫、暫停標記、語言偏向與語氣標籤(如 whispers、shouts)。此工具主要用於 Claude Code、Cursor 等開發環境,特別適合需要語音回覆的場景(如角色扮演對話)。使用者只需設定 `ELEVENLABS_API_KEY` 即可開始使用,並可自訂語音 ID 與輸出檔案路徑。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/elizaOS/eliza/sag

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

sag

使用 sag 進行 ElevenLabs TTS 與本地播放。

API 金鑰(必要)

  • ELEVENLABS_API_KEY(建議)
  • 指令列也支援 SAG_API_KEY

快速開始

  • sag "Hello there"
  • sag speak -v "Roger" "Hello"
  • sag voices
  • sag prompting(模型專屬提示)

模型備註

  • 預設:eleven_v3(表達力強)
  • 穩定:eleven_multilingual_v2
  • 快速:eleven_flash_v2_5

發音與呈現規則

  • 首要修正:重新拼寫(例如 "key-note"),加入連字號,調整大小寫。
  • 數字/單位/URL:--normalize auto(若影響名稱則使用 off)。
  • 語言偏好:--lang en|de|fr|... 以引導正規化。
  • v3:不支援 SSML <break>;請使用 [pause]、[short pause]、[long pause]。
  • v2/v2.5:支援 SSML <break time="1.5s" />;但 sag 未開放 <phoneme>。

v3 音訊標籤(放在行首)

  • [whispers]、[shouts]、[sings]
  • [laughs]、[starts laughing]、[sighs]、[exhales]
  • [sarcastic]、[curious]、[excited]、[crying]、[mischievously]
  • 範例:sag "[whispers] keep this quiet. [short pause] ok?"

語音預設值

  • ELEVENLABS_VOICE_ID 或 SAG_VOICE_ID

在輸出長音訊前,先確認語音與說話者。

聊天語音回覆

當 Peter 要求「語音」回覆時(例如「瘋狂科學家語音」、「用語音解釋」),產生音訊並發送:

# 產生音訊檔案
sag -v Clawd -o /tmp/voice-reply.mp3 "Your message here"

# 然後在回覆中包含:
# MEDIA:/tmp/voice-reply.mp3

語音角色提示:

  • 瘋狂科學家:使用 [excited] 標籤、戲劇性停頓 [short pause],變化強度
  • 冷靜:使用 [whispers] 或較慢的節奏
  • 戲劇化:適量使用 [sings] 或 [shouts]

Clawd 的預設語音:lj2rcrvANS3gaWWnczSX(或直接使用 -v Clawd)

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能