Install
openclaw skills install voice-bridge-light提供兼容OpenAI接口的轻量级本地STT(Whisper)和TTS(Edge TTS/Piper)语音桥接HTTP服务。
openclaw skills install voice-bridge-lightLightweight offline voice bridging service providing OpenAI-compatible STT/TTS HTTP API.
pip install -r requirements.txt
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
| Endpoint | Method | Description |
|---|---|---|
GET /health | GET | Health check |
POST /audio/speech | POST | TTS speech synthesis |
POST /audio/transcriptions | POST | STT speech recognition |
| Variable | Default | Description |
|---|---|---|
VOICE_BRIDGE_HOST | 0.0.0.0 | Listen address |
VOICE_BRIDGE_PORT | 18790 | Listen port |
TTS_ENGINE | edge | TTS engine: edge or piper |
EDGE_VOICE | zh-CN-XiaoxiaoNeural | Edge TTS voice |
PIPER_MODEL | models/piper/zh_CN-huayan-medium.onnx | Piper model path |
STT_MODEL | base | Whisper model size |
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
curl -X POST http://localhost:18790/audio/transcriptions \
-F "file=@speech.mp3" \
-H "Content-Type: multipart/form-data"
Configure in openclaw.json:
{
"tts": {
"enabled": true,
"provider": "local-piper",
"baseUrl": "http://127.0.0.1:18790",
"apiKey": "local",
"voice": "zh-CN-XiaoxiaoNeural"
}
}
[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
MIT