skills$openclaw/homepod-tts
propersama3.2k

by propersama

homepod-tts – OpenClaw Skill

homepod-tts is an OpenClaw Skills integration for productivity workflows. 使用 Qwen3-TTS 生成 TTS 语音并通过 HomePod 播放。当用户说"播放语音到HomePod"、"用HomePod对我说话"、"让HomePod播报XXX"时触发。

3.2k stars2.1k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026productivity

Skill Snapshot

namehomepod-tts
description使用 Qwen3-TTS 生成 TTS 语音并通过 HomePod 播放。当用户说"播放语音到HomePod"、"用HomePod对我说话"、"让HomePod播报XXX"时触发。 OpenClaw Skills integration.
ownerpropersama
repositorypropersama/homepod-tts
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @propersama/homepod-tts
last updatedFeb 7, 2026

Maintainer

propersama

propersama

Maintains homepod-tts in the OpenClaw Skills directory.

View GitHub profile
File Explorer
8 files
.
scripts
play-tts.sh
4.2 KB
tts
tts_sample.py
4.3 KB
_meta.json
278 B
DEPENDENCIES.md
1.5 KB
README.md
3.1 KB
SKILL.md
1.6 KB
SKILL.md

name: homepod-tts description: 使用 Qwen3-TTS 生成 TTS 语音并通过 HomePod 播放。当用户说"播放语音到HomePod"、"用HomePod对我说话"、"让HomePod播报XXX"时触发。

HomePod TTS

使用 HomePod 播放 TTS 语音(支持情绪识别)。

工作流程

  1. 自动情绪识别:根据文本内容自动判断情绪(开心、悲伤、生气、惊讶等)
  2. 生成语音:调用 Qwen3-TTS 生成 WAV 文件
  3. 启动 HTTP 服务:Serving 音频文件供 Home Assistant 访问
  4. 发送到 HomePod:调用 Home Assistant media_player.play_media 服务播放

情绪识别规则

关键词示例检测情绪
开心、高兴、太棒了、nice🎉 开心
激动、兴奋、冲鸭、加油✨ 兴奋
难过、伤心、哭了、心痛😢 悲伤
生气、愤怒、可恶、气死😠 生气
惊讶、震惊、卧槽、居然😲 惊讶
害怕、吓人、救命、妈呀😨 恐惧
警告、注意、严肃、认真⚠️ 严肃
晚安、早上好、温柔、爱你💕 温柔
没关系、淡定、稳住🧘 平静
搞笑、笑话、哈哈😂 幽默
累了、困了、好累😴 疲惫
紧张、焦虑、担心😰 紧张

无匹配关键词时使用默认情绪:开心、热情、语速稍快

音量自动调节

播放时自动将 HomePod 音量设为 40%,播放完成后自动恢复原音量。

动态等待时间

等待时间根据生成的音频时长自动计算音频时长 + 1秒

例如:3秒的语音 → 等待4秒后恢复音量

README.md

homepod-tts 🎙️

使用 Qwen3-TTS 语音克隆和 Home Assistant,通过 HomePod 播放带情绪的 TTS 语音。

✨ 特性

  • 🎭 自动情绪识别 - 根据文本内容自动判断情绪(开心、悲伤、生气、惊讶等)
  • 🔊 音量自动调节 - 播放前设为 40%,播放完成后恢复原音量
  • ⏱️ 动态等待时间 - 根据音频时长自动计算等待时间
  • 🏠 无缝集成 Home Assistant - 通过 HA API 控制 HomePod

📋 前置要求

1. Home Assistant

  • Home Assistant 已安装并运行
  • 获取 Long-Lived Access Token
    • 登录 Home Assistant → 点击右上角头像
    • → Long-Lived Access Tokens → 创建令牌
  • 确认 HomePod 实体 ID(开发者工具 → 状态 → 搜索 media_player

2. Qwen3-TTS

# 安装 Miniforge/Miniconda
# 创建并激活环境
conda create -n qwen-tts python=3.10
conda activate qwen-tts

# 安装依赖
pip install torch soundfile
pip install modelscope
pip install Qwen/Qwen3-TTS-12Hz-0___6B-Base

# 或参考官方文档:https://github.com/Qwen/Qwen3-TTS

3. 参考音频

准备一段你的参考音频(.wav 格式,5-30 秒清晰人声),用于语音克隆。

🚀 快速开始

1. 克隆仓库

git clone https://github.com/yourusername/homepod-tts.git
cd homepod-tts

2. 准备 TTS 脚本

本仓库提供 tts/tts_sample.py 示例脚本,你需要:

# 1. 创建 tts 目录并放入脚本
mkdir -p tts
# 复制 tts_sample.py 到 tts/ 目录

# 2. 准备参考音频
mkdir -p tts/your_ref_audio
# 放入你的参考音频 .wav 文件

# 3. 编辑 tts_sample.py
vim tts/tts_sample.py
# 修改 REF_AUDIO 和 REF_TEXT 为你的配置

3. 配置环境

cp .env.example .env
vim .env

4. 运行

./scripts/play-tts.sh "你好,这是测试消息"

📁 文件结构

homepod-tts/
├── README.md           # 本说明文件
├── .env.example       # 配置模板
├── .gitignore
├── scripts/
│   └── play-tts.sh    # 主播放脚本
└── tts/
    └── tts_sample.py  # TTS 示例脚本(需配置)

⚙️ 配置说明

配置项说明默认值
HASS_URLHome Assistant URLhttp://homeassistant.local:8123
HASS_TOKENHome Assistant 访问令牌必填
HASS_ENTITY_IDHomePod 实体 IDmedia_player.ci_wo
HTTP_PORT本地 HTTP 服务端口8080
LOCAL_IP本机 IP 地址必填
CONDA_ENV_NAMEConda 环境名qwen-tts
TTS_DIRTTS 脚本目录必填

🎭 情绪识别

根据文本关键词自动识别情绪,支持:happy, excited, sad, angry, surprised, scared, serious, gentle, calm, funny, tired, nervous

🔧 故障排除

  • CondaError: 确保 conda 已正确安装
  • Could not resolve host: 检查 HASS_URL 配置
  • 无声音: 检查 HA 连接和实体 ID

📝 许可证

MIT License

🙏 致谢

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install homepod-tts?

Run openclaw add @propersama/homepod-tts in your terminal. This installs homepod-tts into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/propersama/homepod-tts. Review commits and README documentation before installing.