[PR #54] [CLOSED] Add macos-tts Skill: macOS Native Text-to-Speech #53

Closed
opened 2026-02-15 18:15:20 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/skills/pull/54
Author: @YichenWei0601
Created: 2/9/2026
Status: Closed

Base: mainHead: add-macos-tts


📝 Commits (1)

  • 6eec30c Add macos-tts skill: macOS local text-to-speech using native 'say' command

📊 Changes

4 files changed (+232 additions, -0 deletions)

View changed files

skills/YichenWei0601/macos-tts/SKILL.md (+84 -0)
skills/YichenWei0601/macos-tts/scripts/play_latest.sh (+22 -0)
skills/YichenWei0601/macos-tts/scripts/say.sh (+101 -0)
skills/YichenWei0601/macos-tts/scripts/voices.sh (+25 -0)

📄 Description

Add macos-tts Skill: macOS Native Text-to-Speech

Summary

This PR adds a new skill macos-tts that enables text-to-speech functionality on macOS using the native say command. It provides automatic voice generation and playback for Clawdbot responses.

Features

  • 🎯 Smart Keyword Detection: Automatically detects voice-related keywords in multiple languages

    • Chinese: 读出来, 播放, 语音, 说给我听, TTS, 读给我, 播报
    • English: voice, speak, read aloud, play audio
  • 🗣️ Native macOS Integration: Uses built-in say command - no additional dependencies required

  • 🎵 Automatic Playback: Plays generated audio using afplay

  • 🧹 File Management: Automatically manages voice files, keeping only the latest at /tmp/clawdbot_voice_latest.aiff

  • ⚙️ Configurable: Supports custom voices and speech rates

Files Added

macos-tts/
├── SKILL.md              # Skill documentation and usage guide
└── scripts/
    └── tts.sh            # Bash script for TTS generation and playback

macos-tts.skill           # Packaged skill file (2.6KB)

Usage Examples

Basic Usage

# Generate and play speech
say -o /tmp/clawdbot_voice_latest.aiff "Hello World"
afplay /tmp/clawdbot_voice_latest.aiff

# Using the provided script
./scripts/tts.sh "Text to speak"

With Custom Voice

# Use Chinese voice
say -v Ting-Ting "你好世界"

# Adjust speech rate
say -r 200 "Faster speech"
say -r 100 "Slower speech"

How It Works

  1. Detection: Clawdbot detects voice-related keywords in user messages
  2. Generation: Converts response text to speech using say -o
  3. Playback: Automatically plays the audio using afplay
  4. Cleanup: Overwrites previous voice file to save disk space

Technical Details

  • Voice Output: AIFF format at /tmp/clawdbot_voice_latest.aiff
  • Dependencies: None (uses macOS built-in commands)
  • Compatibility: macOS 10.6+ (Snow Leopard and later)

Testing

  • Tested on macOS Sonoma 14.x
  • Script executes successfully with various text inputs
  • Voice file cleanup works as expected
  • Multiple voice options verified

Checklist

  • Skill follows naming conventions (macos-tts)
  • SKILL.md includes proper frontmatter (name, description)
  • Description includes trigger keywords and usage scenarios
  • Scripts are executable and tested
  • Skill packaged correctly (.skill file)
  • No extraneous files included

Related

  • Based on user request for automatic voice播报 functionality
  • Uses macOS native TTS to avoid external API dependencies

Skill Maintainer: @YichenWei0601
#colaborated with kimi2.5


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/skills/pull/54 **Author:** [@YichenWei0601](https://github.com/YichenWei0601) **Created:** 2/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `add-macos-tts` --- ### 📝 Commits (1) - [`6eec30c`](https://github.com/openclaw/skills/commit/6eec30cd14ea9a999f2559d39efaf6712c827ce1) Add macos-tts skill: macOS local text-to-speech using native 'say' command ### 📊 Changes **4 files changed** (+232 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `skills/YichenWei0601/macos-tts/SKILL.md` (+84 -0) ➕ `skills/YichenWei0601/macos-tts/scripts/play_latest.sh` (+22 -0) ➕ `skills/YichenWei0601/macos-tts/scripts/say.sh` (+101 -0) ➕ `skills/YichenWei0601/macos-tts/scripts/voices.sh` (+25 -0) </details> ### 📄 Description # Add macos-tts Skill: macOS Native Text-to-Speech ## Summary This PR adds a new skill `macos-tts` that enables text-to-speech functionality on macOS using the native `say` command. It provides automatic voice generation and playback for Clawdbot responses. ## Features - 🎯 **Smart Keyword Detection**: Automatically detects voice-related keywords in multiple languages - Chinese: 读出来, 播放, 语音, 说给我听, TTS, 读给我, 播报 - English: voice, speak, read aloud, play audio - 🗣️ **Native macOS Integration**: Uses built-in `say` command - no additional dependencies required - 🎵 **Automatic Playback**: Plays generated audio using `afplay` - 🧹 **File Management**: Automatically manages voice files, keeping only the latest at `/tmp/clawdbot_voice_latest.aiff` - ⚙️ **Configurable**: Supports custom voices and speech rates ## Files Added ``` macos-tts/ ├── SKILL.md # Skill documentation and usage guide └── scripts/ └── tts.sh # Bash script for TTS generation and playback macos-tts.skill # Packaged skill file (2.6KB) ``` ## Usage Examples ### Basic Usage ```bash # Generate and play speech say -o /tmp/clawdbot_voice_latest.aiff "Hello World" afplay /tmp/clawdbot_voice_latest.aiff # Using the provided script ./scripts/tts.sh "Text to speak" ``` ### With Custom Voice ```bash # Use Chinese voice say -v Ting-Ting "你好世界" # Adjust speech rate say -r 200 "Faster speech" say -r 100 "Slower speech" ``` ## How It Works 1. **Detection**: Clawdbot detects voice-related keywords in user messages 2. **Generation**: Converts response text to speech using `say -o` 3. **Playback**: Automatically plays the audio using `afplay` 4. **Cleanup**: Overwrites previous voice file to save disk space ## Technical Details - **Voice Output**: AIFF format at `/tmp/clawdbot_voice_latest.aiff` - **Dependencies**: None (uses macOS built-in commands) - **Compatibility**: macOS 10.6+ (Snow Leopard and later) ## Testing - [x] Tested on macOS Sonoma 14.x - [x] Script executes successfully with various text inputs - [x] Voice file cleanup works as expected - [x] Multiple voice options verified ## Checklist - [x] Skill follows naming conventions (`macos-tts`) - [x] SKILL.md includes proper frontmatter (name, description) - [x] Description includes trigger keywords and usage scenarios - [x] Scripts are executable and tested - [x] Skill packaged correctly (`.skill` file) - [x] No extraneous files included ## Related - Based on user request for automatic voice播报 functionality - Uses macOS native TTS to avoid external API dependencies --- **Skill Maintainer**: @YichenWei0601 #colaborated with kimi2.5 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 18:15:20 -05:00
yindo closed this issue 2026-02-15 18:15:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/skills#53