Merge pull request #2332 from hankehly/fix-piper-tts-json-payload

Fix PiperTTSService to send TTS input as JSON object
This commit is contained in:
Mark Backman
2025-08-03 17:39:04 -07:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed an issue in `LiveKitTransport` where empty `AudioRawFrame`s were pushed
down the pipeline. This resulted in warnings by the STT processor.
- Fixed `PiperTTSService` to send text as a JSON object in the request body,
resolving compatibility with Piper's HTTP API.
- Fixed an issue with the `TavusVideoService` where an error was thrown due to
missing transcription callbacks.

View File

@@ -84,7 +84,9 @@ class PiperTTSService(TTSService):
try:
await self.start_ttfb_metrics()
async with self._session.post(self._base_url, json=text, headers=headers) as response:
async with self._session.post(
self._base_url, json={"text": text}, headers=headers
) as response:
if response.status != 200:
error = await response.text()
logger.error(