From 694922f627c1aae476ed10ddcdc43e74f4138171 Mon Sep 17 00:00:00 2001 From: hankehly Date: Sat, 2 Aug 2025 15:29:16 +0900 Subject: [PATCH 1/5] Fix PiperTTSService to send TTS input as JSON object --- src/pipecat/services/piper/tts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/piper/tts.py b/src/pipecat/services/piper/tts.py index 7892e15fa..8c7743d32 100644 --- a/src/pipecat/services/piper/tts.py +++ b/src/pipecat/services/piper/tts.py @@ -84,7 +84,8 @@ class PiperTTSService(TTSService): try: await self.start_ttfb_metrics() - async with self._session.post(self._base_url, json=text, headers=headers) as response: + payload = {"text": text} + async with self._session.post(self._base_url, json=payload, headers=headers) as response: if response.status != 200: error = await response.text() logger.error( From 7646599b6644eb410d8b6f468f2d50a5296f6fc3 Mon Sep 17 00:00:00 2001 From: hankehly Date: Sun, 3 Aug 2025 10:23:58 +0900 Subject: [PATCH 2/5] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31a76c75..d28d9faf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,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. ## [0.0.77] - 2025-07-31 From 68164415ce6dd73604023d4017ae0ba83f9aa68d Mon Sep 17 00:00:00 2001 From: hankehly Date: Sun, 3 Aug 2025 10:26:37 +0900 Subject: [PATCH 3/5] Format changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d28d9faf0..5c0573749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ 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, +- Fixed `PiperTTSService` to send text as a JSON object in the request body, resolving compatibility with Piper's HTTP API. ## [0.0.77] - 2025-07-31 From 2177a2b8052d2911b4732a61941747044774922c Mon Sep 17 00:00:00 2001 From: hankehly Date: Sun, 3 Aug 2025 10:34:27 +0900 Subject: [PATCH 4/5] Remove trailing space --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c0573749..08f0f2032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ 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. + resolving compatibility with Piper's HTTP API. ## [0.0.77] - 2025-07-31 From 77057eb829c4459ac4e4a0ad321f5db7b459b9e0 Mon Sep 17 00:00:00 2001 From: hankehly Date: Mon, 4 Aug 2025 08:13:16 +0900 Subject: [PATCH 5/5] Fix ruff formatting --- src/pipecat/services/piper/tts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/piper/tts.py b/src/pipecat/services/piper/tts.py index 8c7743d32..d5b663c77 100644 --- a/src/pipecat/services/piper/tts.py +++ b/src/pipecat/services/piper/tts.py @@ -84,8 +84,9 @@ class PiperTTSService(TTSService): try: await self.start_ttfb_metrics() - payload = {"text": text} - async with self._session.post(self._base_url, json=payload, 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(