使用Google Cloud Chirp 3 HD语音的高保真生成式语音合成,提供卓越的真实感、情感表现力和自然节奏...
Generate ultra-realistic, human-like speech using Google's latest Chirp 3 HD generative models. This skill handles its own dependencies locally to remain portable.
Security Note: On first execution, this skill will run
npm installlocally within its own folder to fetch the official@google-cloud/text-to-speechlibrary from the public npm registry.
Recognize keywords like "tts", "speak", "voice", or "read this out loud" as TTS requests.
Follow these steps every time TTS is needed. Never assume gtts is in PATH — always run via node directly.
gtts.js lives in the same folder as this SKILL.md. Resolve that path:
bash
SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
bash
if ! command -v node &>/dev/null; then
echo "ERROR: Node.js is not installed."
exit 1
fi
NODE_MAJOR=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_MAJOR" -lt 18 ]; then
echo "ERROR: Node.js 18 or higher is required for Google Chirp 3 HD."
exit 1
fi
This installs the package locally inside the skill folder only.
bash
if [ ! -d "$SKILL_DIR/node_modules/@google-cloud/text-to-speech" ]; then
npm install @google-cloud/text-to-speech --prefix "$SKILL_DIR" --silent
fi
bash
node "$SKILL_DIR/gtts.js" --text "$TEXT" --voice "$VOICE" --out "$OUTFILE"
ArgumentDescriptionDefault--textText to synthesize. Supports [pause] tags.(required)--voiceVoice short-name (e.g. Aoede, Charon, Puck)Aoede``--outOutput filename (saved to $OPENCLAW_WORKSPACE)output.mp3
Returns SUCCESS:/absolute/path/to/file.mp3 on success, or ERROR: ... on failure.
GenderRecommended HD VoicesFemaleAchernar (Default), Aoede, Leda, Kore, Zephyr, Despina, Gacrux, VindemiatrixMaleCharon, Puck, Fenrir, Orus, Achird, Algenib, Enceladus
Converted automatically into SSML <break> tags:
TagDuration[pause short]300ms[pause]600ms[pause long]900ms
... for trailing hesitation.Uses Google Application Default Credentials (ADC). One-time setup:
bash
gcloud auth application-default login
RequirementStatusNode.js 18+❌ Must be installed on systemOPENCLAW_WORKSPACEℹ️ Optional (Defaults to current dir)@google-cloud/text-to-speech✅ Auto-installed locally in skill folderGoogle Cloud SDK + ADC login❌ One-time manual step required
[pause] tags.node (18+) is available and OPENCLAW_WORKSPACE is known.node_modules is missing.node "$SKILL_DIR/gtts.js" --text "..." --voice "..." --out "..."SUCCESS: path and confirm to the user.text