mcpField
S
speak-response

speak-response

github.com/tdimino创意与媒体4141 次安装1 周前更新
代码仓库

关于 speak-response

speak-response 使用本地 Qwen3-TTS 将文本转换为语音,适用于需要语音输出的场景。它提供 Oracle 默认音色、带情绪指令的预设说话人,以及克隆或设计音色的流程。

主要功能

  1. 01使用本地 Qwen3-TTS 生成语音
  2. 02默认使用 Oracle 音色
  3. 03支持预设说话人与情绪指令
  4. 04根据音频样本克隆音色
  5. 05通过文本描述设计音色

适用场景

  1. 01朗读最近一条回复
  2. 02按指定情绪朗读文本
  3. 03根据样本创建可复用音色

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/tdimino/claude-code-minoan --skill speak-response

安装后在 Claude Code 中输入/speak-response确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

README.md
qwen3-tts/
clone.py
design.py
generate.py
references/
moods.md
scripts/
clone.sh
design-voice.sh
speak.sh
voices/oracle/
transcript.txt

详细介绍

语音响应

使用本地 Qwen3-TTS 将文本转换为语音。默认音色为 Oracle(克隆自一位《沙丘》旁白,具有深沉、浑厚、充满预言感的特质)。

快速示例

命令效果
/speak使用 Oracle 音色朗读最近 2 个句子
/speak 5使用 Oracle 音色朗读最近 5 个句子
/speak "The sleeper must awaken."使用 Oracle 音色朗读指定文本
/speak --preset mood:warm使用预设说话人和情绪朗读最近 2 个句子
/speak --preset "Hello" speaker:Vivian voice:"nurturing"使用预设说话人和自定义音色

默认音色:Oracle

Oracle 音色深沉、浑厚、充满预言感,克隆自一位《沙丘》旁白。它朗读所有文本时都带有古老智慧与庄严感。

# Default usage - Oracle voice
scripts/speak.sh "The spice must flow."
scripts/speak.sh "He who controls the spice controls the universe."
限制

Oracle 使用音色克隆(Base 模型),不支持按消息控制指令。音色特征是固定的。如需控制情绪或氛围,请使用 --preset。

预设说话人(--preset)

如需控制情绪和氛围,请使用 --preset 切换到可通过指令调整的 CustomVoice:

scripts/speak.sh --preset "<text>" [speaker] [instruction]
预设快速示例
# Calm therapeutic voice
scripts/speak.sh --preset "Take a deep breath." Vivian "calm, nurturing, gentle pace"

# Excited announcement
scripts/speak.sh --preset "We did it!" Ryan "joyful, excited, enthusiastic"

# Serious explanation
scripts/speak.sh --preset "This is important." Eric "serious, measured, emphatic"
自定义音色指令

模型能够理解丰富的自然语言描述:

方面示例
情绪joyful(愉悦)、melancholic(忧郁)、anxious(焦虑)、calm(平静)、excited(兴奋)、contemplative(沉思)
语速slow and deliberate(缓慢而沉稳)、rapid and energetic(快速而有活力)、measured(不疾不徐)、hesitant(犹豫)
强度soft and gentle(轻柔)、loud and commanding(响亮而有威严)、whispered(耳语)、emphatic(强调)
风格warm and nurturing(温暖而体贴)、professional(专业)、playful(俏皮)、dramatic(戏剧化)
韵律with dramatic pauses(带有戏剧性停顿)、rising intonation(语调上扬)、emphatic on key words(强调关键词)
氛围预设(快捷方式)
预设展开为
calm"calm, soothing, gentle pace"
warm"warm, empathetic, nurturing tone"
excited"joyful, excited, enthusiastic"
serious"serious, measured, authoritative"
gentle"soft, gentle, whispered"
encouraging"encouraging, uplifting, sincere"
contemplative"thoughtful, slow pace, reflective"
说话人
说话人最适合
Ryan(默认)专业、严肃、权威
Vivian温暖、体贴、疗愈
Serena平静、温柔、沉思
Dylan友好、随意、俏皮
Eric严肃、戏剧化、威严
Aiden鼓舞人心、振奋、有活力
Uncle_Fu睿智、沉稳
Ono_Anna轻柔、温和
Sohee清晰、专业

工作流

  1. 解析文本和模式参数(默认 Oracle 或 --preset)
  2. 如果未提供文本,则从上一条响应中提取
  3. 默认模式:使用 Oracle 音色克隆
  4. 预设模式:使用 CustomVoice + 指令生成
  5. 通过 macOS 扬声器播放音频

执行

# Oracle voice (default)
scripts/speak.sh "<text>"

# Preset speaker with instruction
scripts/speak.sh --preset "<text>" [speaker] [instruction]

音色克隆(自定义音色)

使用时长为 3 秒以上的音频样本克隆任意音色:

# Get transcript first (use Whisper API)
curl -s https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F file="@reference.mp3" -F model="whisper-1"

# Clone the voice
scripts/clone.sh "<text to speak>" "<audio_file>" "<transcript>"

音色设计(创建新音色)

使用自然语言描述设计全新音色:

scripts/design-voice.sh "<sample_text>" "<voice_description>"

# Example: Create a warm guide voice
scripts/design-voice.sh \
  "Take a deep breath and feel this moment." \
  "warm, nurturing, gentle pace, empathetic, female"

然后克隆设计好的音色以便重复使用:

scripts/clone.sh "New text" designed-voice.wav "Original sample text"

更多指令示例请参阅 references/moods.md。

评论

支持 Markdown