feat: VoiceCoach v2 - OpenClaw gateway + Speaches STT/TTS
- pipeline.py: completely rewritten to use Speaches STT/TTS and OpenClaw LLM - main.py: v2 with OPENCLAW_TOKEN support - requirements.txt: slimmed (removed anthropic, faster-whisper direct deps) - Dockerfile: slimmer build (no model pre-download) - whisper_stt.py, piper_tts.py: removed (replaced by Speaches API) - docker-compose.yml: v2 with speaches + openclaw services, piper-tts removed - openclaw-agent/system_prompt.md: new directory with agent system prompt
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
"""
|
||||
Piper TTS client for Pipecat pipeline.
|
||||
Calls the self-hosted Piper HTTP service.
|
||||
"""
|
||||
import io
|
||||
import logging
|
||||
import wave
|
||||
import httpx
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PiperTTSClient:
|
||||
"""HTTP client for the Piper TTS service."""
|
||||
|
||||
def __init__(self, base_url: str = "http://piper-tts:8003"):
|
||||
self.base_url = base_url.rstrip("/")
|
||||
self._client = httpx.AsyncClient(timeout=10.0)
|
||||
|
||||
async def synthesize(self, text: str) -> bytes:
|
||||
"""Convert text to WAV audio bytes via Piper service."""
|
||||
try:
|
||||
response = await self._client.post(
|
||||
f"{self.base_url}/synthesize",
|
||||
json={"text": text, "length_scale": 0.95, "sentence_silence": 0.15},
|
||||
)
|
||||
response.raise_for_status()
|
||||
return response.content
|
||||
except Exception as e:
|
||||
logger.error(f"Piper TTS failed: {e}")
|
||||
return b""
|
||||
|
||||
async def close(self):
|
||||
await self._client.aclose()
|
||||
Reference in New Issue
Block a user