From 656cbc35e1233681224d1d05dadb5ae8574a0e61 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 19 Dec 2024 12:11:07 -0500 Subject: [PATCH] Make auto_mode an input parametere for ElevenLabsTTSService; add changelog entry --- CHANGELOG.md | 10 +++++++++- src/pipecat/services/elevenlabs.py | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 526775b16..5bdd1cd67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `DailyTransport.send_dtmf()` to send dial-out DTMF tones. - Added `DailyTransport.sip_call_transfer()` to forward SIP and PSTN calls to - another address or number. For example, transfer a SIP call to a different + another address or number. For example, transfer a SIP call to a different SIP address or transfer a PSTN phone number to a different PSTN phone number. - Added `DailyTransport.sip_refer()` to transfer incoming SIP/PSTN calls from outside Daily to another SIP/PSTN address. +- Added an `auto_mode` input parameter to `ElevenLabsTTSService`. `auto_mode` + is set to `True` by default. Enabling this setting disables the chunk + schedule and all buffers, which reduces latency. + - Added `KoalaFilter` which implement on device noise reduction using Koala Noise Suppression. (see https://picovoice.ai/platform/koala/) @@ -51,6 +55,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- `auto_mode: True` for the `ElevenLabsTTSService`. This change + significantly reduces the latency by disabling the chunk schedule and all + buffers. + - `OpenAIRealtimeBetaLLMService` now takes a `model` parameter in the constructor. diff --git a/src/pipecat/services/elevenlabs.py b/src/pipecat/services/elevenlabs.py index e5310003b..cffa90025 100644 --- a/src/pipecat/services/elevenlabs.py +++ b/src/pipecat/services/elevenlabs.py @@ -135,6 +135,7 @@ class ElevenLabsTTSService(WordTTSService): similarity_boost: Optional[float] = None style: Optional[float] = None use_speaker_boost: Optional[bool] = None + auto_mode: Optional[bool] = True @model_validator(mode="after") def validate_voice_settings(self): @@ -193,6 +194,7 @@ class ElevenLabsTTSService(WordTTSService): "similarity_boost": params.similarity_boost, "style": params.style, "use_speaker_boost": params.use_speaker_boost, + "auto_mode": str(params.auto_mode).lower(), } self.set_model_name(model) self.set_voice(voice_id) @@ -312,7 +314,7 @@ class ElevenLabsTTSService(WordTTSService): voice_id = self._voice_id model = self.model_name output_format = self._settings["output_format"] - url = f"{self._url}/v1/text-to-speech/{voice_id}/stream-input?model_id={model}&output_format={output_format}&auto_mode=true" + url = f"{self._url}/v1/text-to-speech/{voice_id}/stream-input?model_id={model}&output_format={output_format}&auto_mode={self._settings['auto_mode']}" if self._settings["optimize_streaming_latency"]: url += f"&optimize_streaming_latency={self._settings['optimize_streaming_latency']}"