← 返回
未分类 中文

Voice Bridge Light

提供兼容OpenAI接口的轻量级本地STT(Whisper)和TTS(Edge TTS/Piper)语音桥接HTTP服务。
提供兼容OpenAI接口的轻量级本地STT(Whisper)和TTS(Edge TTS/Piper)语音桥接HTTP服务。
fangbb-coder
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 527
下载
💾 2
安装
1
版本
#latest#openai-compatible#stt#tts#voice

概述

Voice Bridge Light

Lightweight offline voice bridging service providing OpenAI-compatible STT/TTS HTTP API.

Features

  • TTS Text-to-Speech: Supports Edge TTS (online) and Piper (local)
  • STT Speech Recognition: Based on Whisper local recognition
  • OpenAI Compatible API: Compatible with OpenAI Audio API
  • Lightweight Deployment: Minimal dependencies, easy to install

Usage

Installation

pip install -r requirements.txt

Start Service

Default using Edge TTS:

python api_server.py

Using Piper (model required):

TTS_ENGINE=piper PIPER_MODEL=models/piper/zh_CN-huayan-medium.onnx python api_server.py

API Endpoints

EndpointMethodDescription
-------------------------------
GET /healthGETHealth check
POST /audio/speechPOSTTTS speech synthesis
POST /audio/transcriptionsPOSTSTT speech recognition

Configuration Environment Variables

VariableDefaultDescription
--------------------------------
VOICE_BRIDGE_HOST0.0.0.0Listen address
VOICE_BRIDGE_PORT18790Listen port
TTS_ENGINEedgeTTS engine: edge or piper
EDGE_VOICEzh-CN-XiaoxiaoNeuralEdge TTS voice
PIPER_MODELmodels/piper/zh_CN-huayan-medium.onnxPiper model path
STT_MODELbaseWhisper model size

TTS Request Example

curl -X POST http://localhost:18790/audio/speech \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Hello, world!",
    "voice": "zh-CN-XiaoxiaoNeural",
    "response_format": "mp3"
  }' \
  --output speech.mp3

STT Request Example

curl -X POST http://localhost:18790/audio/transcriptions \
  -F "file=@speech.mp3" \
  -H "Content-Type: multipart/form-data"

OpenClaw Integration

Configure in openclaw.json:

{
  "tts": {
    "enabled": true,
    "provider": "local-piper",
    "baseUrl": "http://127.0.0.1:18790",
    "apiKey": "local",
    "voice": "zh-CN-XiaoxiaoNeural"
  }
}

Dependencies

  • Python 3.8+
  • edge-tts (Edge TTS)
  • faster-whisper (Whisper STT)
  • soundfile (audio processing)
  • Flask + Flask-CORS (web service)

Service Management

systemd Service (Recommended)

[Unit]
Description=Voice Bridge Light - STT/TTS HTTP API
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/.openclaw/workspace/skills/voice-bridge-light
ExecStart=/usr/bin/python3 api_server.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Enable and start:

systemctl daemon-reload
systemctl enable voice-bridge-light.service
systemctl start voice-bridge-light.service

Performance

  • TTS latency: < 1s (Edge TTS requires network)
  • STT latency: depends on audio length, real-time CPU
  • Memory usage: ~300-500MB (mainly from Whisper model)

Notes

  • Edge TTS requires internet access to Microsoft services
  • Piper requires downloading model files (first use)
  • Whisper model loads slowly on first run, recommend warm-up
  • Production environment recommended to use systemd management

License

MIT

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-30 18:11 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

deerflow-install-master

fangbb-coder
DeerFlow 2.0 一键安装与配置技能。基于实际部署经验(2026‑03‑29),覆盖从仓库下载到成功运行的全流程,含避坑指南。适用场景:(1) 在 OpenClaw 环境安装 DeerFlow 2.0;(2) 快速排查安装问题;(3
★ 1 📥 667

connect-to-another-openclaw

fangbb-coder
远程连接并管理另一台 OpenClaw 服务器,检查状态、同步技能、重启网关、监控频道。
★ 0 📥 371

Backup 2 Github

fangbb-coder
备份OpenClaw个性化配置和用户数据到GitHub仓库,支持单次提交历史记录和可选的预览功能。
★ 0 📥 654