From eb1bf1e44680d7ce40d4f5096d4a4613c5d290ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 28 Jan 2026 23:27:32 -0800 Subject: [PATCH] tts: rename PiperTTSService to PiperHttpTTSService --- examples/foundational/01-say-one-thing-piper.py | 4 ++-- src/pipecat/services/piper/tts.py | 7 ++++--- tests/test_piper_tts.py | 12 ++++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/examples/foundational/01-say-one-thing-piper.py b/examples/foundational/01-say-one-thing-piper.py index 5aa975b31..f6700f886 100644 --- a/examples/foundational/01-say-one-thing-piper.py +++ b/examples/foundational/01-say-one-thing-piper.py @@ -16,7 +16,7 @@ from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineTask from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.piper.tts import PiperTTSService +from pipecat.services.piper.tts import PiperHttpTTSService from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams @@ -39,7 +39,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Create an HTTP session async with aiohttp.ClientSession() as session: - tts = PiperTTSService( + tts = PiperHttpTTSService( base_url=os.getenv("PIPER_BASE_URL"), aiohttp_session=session, sample_rate=24000 ) diff --git a/src/pipecat/services/piper/tts.py b/src/pipecat/services/piper/tts.py index ce47c885e..19d9720f0 100644 --- a/src/pipecat/services/piper/tts.py +++ b/src/pipecat/services/piper/tts.py @@ -21,9 +21,10 @@ from pipecat.services.tts_service import TTSService from pipecat.utils.tracing.service_decorators import traced_tts -# This assumes a running TTS service running: https://github.com/OHF-Voice/piper1-gpl/blob/main/docs/API_HTTP.md -class PiperTTSService(TTSService): - """Piper TTS service implementation. +# This assumes a running TTS service running: +# https://github.com/OHF-Voice/piper1-gpl/blob/main/docs/API_HTTP.md +class PiperHttpTTSService(TTSService): + """Piper HTTP TTS service implementation. Provides integration with Piper's HTTP TTS server for text-to-speech synthesis. Supports streaming audio generation with configurable sample diff --git a/tests/test_piper_tts.py b/tests/test_piper_tts.py index e52be2d91..8d877099c 100644 --- a/tests/test_piper_tts.py +++ b/tests/test_piper_tts.py @@ -21,7 +21,7 @@ from pipecat.frames.frames import ( TTSStoppedFrame, TTSTextFrame, ) -from pipecat.services.piper.tts import PiperTTSService +from pipecat.services.piper.tts import PiperHttpTTSService from pipecat.tests.utils import run_test @@ -67,8 +67,10 @@ async def test_run_piper_tts_success(aiohttp_client): base_url = str(client.make_url("")).rstrip("/") async with aiohttp.ClientSession() as session: - # Instantiate PiperTTSService with our mock server - tts_service = PiperTTSService(base_url=base_url, aiohttp_session=session, sample_rate=24000) + # Instantiate PiperHttpTTSService with our mock server + tts_service = PiperHttpTTSService( + base_url=base_url, aiohttp_session=session, sample_rate=24000 + ) frames_to_send = [ TTSSpeakFrame(text="Hello world."), @@ -117,7 +119,9 @@ async def test_run_piper_tts_error(aiohttp_client): base_url = str(client.make_url("")).rstrip("/") async with aiohttp.ClientSession() as session: - tts_service = PiperTTSService(base_url=base_url, aiohttp_session=session, sample_rate=24000) + tts_service = PiperHttpTTSService( + base_url=base_url, aiohttp_session=session, sample_rate=24000 + ) frames_to_send = [ TTSSpeakFrame(text="Error case."),