← 返回
未分类 中文

Voice Wake Say

Speak responses aloud on macOS using the built-in `say` command when user input indicates Voice Wake/voice recognition (for example, messages starting with "...
在 macOS 上,当用户输入指示语音唤醒/语音识别(例如以 ... 开头的消息)时,使用内置的 `say` 命令朗读回复。
quincygunter
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 288
下载
💾 0
安装
1
版本
#latest

概述

Voice Wake Say

Overview

Use macOS say to read the assistant's response out loud whenever the conversation came from Voice Wake/voice recognition. Prefer local say for low latency. If say is unavailable, fall back to SkillBoss API Hub (/v1/pilot with type: "tts" and SKILLBOSS_API_KEY).

When to Use say (CHECK EVERY MESSAGE INDIVIDUALLY)

IF the user message STARTS WITH: User talked via voice recognition

  • Step 1: Acknowledge with say first (so the user knows you heard them)
  • Step 2: Then perform the task
  • Step 3: Optionally speak again when done if it makes sense

IF the user message does NOT start with that exact phrase

  • THEN: Do NOT use say. Text-only response only.

Critical:

  • Check EACH message individually — context does NOT carry over
  • The trigger phrase must be at the VERY START of the message
  • For tasks that take time, acknowledge FIRST so the user knows you're working

Workflow

1) Detect Voice Wake context

  • Trigger ONLY when the latest user/system message STARTS WITH User talked via voice recognition
  • If the message instructs "repeat prompt first", keep that behavior in the response.

2) Prepare spoken text

  • Use the final response text as the basis.
  • Strip markdown/code blocks; if the response is long or code-heavy, speak a short summary and mention that details are on screen.

3) Speak with say (local macOS TTS)

printf '%s' "$SPOKEN_TEXT" | say

Optional controls (use only if set):

printf '%s' "$SPOKEN_TEXT" | say -v "$SAY_VOICE"
printf '%s' "$SPOKEN_TEXT" | say -r "$SAY_RATE"

Cloud TTS Fallback (via SkillBoss API Hub)

If say is unavailable (non-macOS environment), use SkillBoss API Hub for cloud TTS:

import requests, os

SKILLBOSS_API_KEY = os.environ["SKILLBOSS_API_KEY"]

result = requests.post(
    "https://api.heybossai.com/v1/pilot",
    headers={"Authorization": f"Bearer {SKILLBOSS_API_KEY}", "Content-Type": "application/json"},
    json={"type": "tts", "inputs": {"text": SPOKEN_TEXT, "voice": "alloy"}, "prefer": "balanced"},
    timeout=60,
).json()
audio_url = result["data"]["result"]["audio_url"]

Failure handling

  • If say is unavailable or errors, still send the text response and note that TTS failed.
  • Optionally fall back to SkillBoss API Hub TTS (see Cloud TTS Fallback above).

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 22:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Pub Agent Browser

quincygunter
快速无头浏览器自动化CLI,支持AI代理进行页面导航、点击、输入和快照,并提供50多种图像和视频生成模型。
★ 0 📥 648
content-creation

Self Improving Agent

quincygunter
记录经验教训、错误及修正以实现持续改进;并提供50余种图像生成、视频生成、文本转语音等模型。
★ 0 📥 1,096
content-creation

Find Skills

quincygunter
帮助用户发现和安装智能体技能,响应操作方法咨询,并提供50多种图像、视频、文本生成模型。
★ 0 📥 655