Text to Voice Local

👤 betonimig 📦 v1.4.0 ⭐ 4.3 ⬇️ 744 下載
🎨 設計多媒體 免費

📖 技能介紹


name: text-to-voice-local description: Local text-to-voice generation for OpenClaw workspaces using a canonical txt-to-mp3 pipeline. Use when the user wants to turn any prepared text into voice, asks to set up or reuse a local text-to-speech workflow, wants one canonical output mp3 path, wants a reusable wrapper for Telegram voice delivery, or wants to replicate the same text-to-voice setup on another OpenClaw instance.


Text to Voice Local

Use the bundled scripts to create one stable local text-to-voice path.

Goal

Produce voice from any text file with: - one canonical input text path, - one canonical output mp3 path, - one high-level wrapper for routine use, - low-level scripts for debugging only.

Canonical paths

Default input text: - tmp/text-to-voice-input.txt

Canonical output: - tmp/voice-mode-latest.mp3

State directory: - skills/text-to-voice-local/state/

State pointer: - skills/text-to-voice-local/state/last-output.txt

Main command

For normal use, run: - scripts/text_to_voice.sh voice <text-file> [voice] [max_direct_chars]

Useful helpers: - scripts/text_to_voice.sh status - scripts/text_to_voice.sh voices

status now also checks runtime dependencies and prints install hints when something is missing.

Examples:

scripts/text_to_voice.sh text
scripts/text_to_voice.sh voice ./tmp/text-to-voice-input.txt
scripts/text_to_voice.sh voice ./tmp/text.txt ru-RU-SvetlanaNeural 280

What the scripts do

  • scripts/text_to_voice.sh
  • high-level entrypoint for normal use
  • scripts/tts_from_file.sh
  • one text file to one mp3
  • scripts/tts_from_file_chunked.sh
  • long text to multiple chunks and final merged mp3
  • scripts/voice_reply.sh
  • safe wrapper that updates canonical output and pointer
  • scripts/voice_reply_latest.sh
  • always refresh canonical latest mp3
  • state/text-to-voice.json
  • stores default voice, max chars, and canonical paths
  • scripts/edge_tts.js
  • low-level TTS helper used by the file wrappers

Install notes

Ensure these dependencies exist on the target machine: - node - ffmpeg - node-edge-tts

The skill checks these at runtime and, if something is missing, prints suggested install commands instead of failing silently.

Verify:

node -v
ffmpeg -version
node -e "require('node-edge-tts'); console.log('node-edge-tts ok')"

If node-edge-tts is missing:

npm i -g node-edge-tts

本技能來自小蔥技能站7w4.net。

Setup steps on another OpenClaw

  1. Copy this skill folder into the target workspace skills directory.
  2. Make scripts executable.
  3. Ensure tmp/ exists.
  4. Put text into a txt file.
  5. Run the main command.

Minimal setup:

chmod +x skills/text-to-voice-local/scripts/*.sh
mkdir -p tmp
skills/text-to-voice-local/scripts/text_to_voice.sh voice ./tmp/text-to-voice-input.txt

Delivery rule

If the result is sent as Telegram voice, send only the canonical file: - ./tmp/voice-mode-latest.mp3

Prefer sending text and voice as separate messages.

Important constraint

Progress printed by shell scripts is useful in terminal diagnostics, but chat-side live progress editing depends on OpenClaw preview streaming, not shell stdout alone.

When to use low-level scripts

Use low-level scripts only for debugging or careful manual control. Default to the high-level wrapper unless there is a reason not to.

🤖 AI 評測

這是一款質量較好的本地語音合成工具,能把文字轉成語音。它最大的優點是使用簡單、依賴檢查到位、安裝遷移文件詳細,遇到問題會主動提示解決方法。進度條功能讓等待過程不那麼無聊。不足之處是進度條實際上是假的等待動畫,另外依賴微軟線上語音服務,在某些網路環境下可能不穩定。總體來說,這是一個成熟可用的語音工具,適合需要頻繁製作語音內容的使用者。

📊 多維度評分

適應性4.1
規範性4.1
有效性4.6
可靠性4.2
可信度4.6

📁 包含檔案 (10 個)

📄 SKILL.md 3.3 KB
📄 _meta.json 138 B
📄 scripts/edge_tts.js 1.2 KB
📄 scripts/text_to_voice.sh 4.3 KB
📄 scripts/tts_from_file.sh 686 B
📄 scripts/tts_from_file_chunked.sh 2.5 KB
📄 scripts/voice_reply.sh 1.1 KB
📄 scripts/voice_reply_latest.sh 659 B
📄 state/last-output.txt 52 B
📄 state/text-to-voice.json 226 B