Make auto_mode an input parametere for ElevenLabsTTSService; add changelog entry

This commit is contained in:
Mark Backman
2024-12-19 12:11:07 -05:00
parent 6f7c4dd998
commit 656cbc35e1
2 changed files with 12 additions and 2 deletions

View File

@@ -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.send_dtmf()` to send dial-out DTMF tones.
- Added `DailyTransport.sip_call_transfer()` to forward SIP and PSTN calls to - 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. 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 - Added `DailyTransport.sip_refer()` to transfer incoming SIP/PSTN calls from
outside Daily to another SIP/PSTN address. 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 - Added `KoalaFilter` which implement on device noise reduction using Koala
Noise Suppression. Noise Suppression.
(see https://picovoice.ai/platform/koala/) (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 ### 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 - `OpenAIRealtimeBetaLLMService` now takes a `model` parameter in the
constructor. constructor.

View File

@@ -135,6 +135,7 @@ class ElevenLabsTTSService(WordTTSService):
similarity_boost: Optional[float] = None similarity_boost: Optional[float] = None
style: Optional[float] = None style: Optional[float] = None
use_speaker_boost: Optional[bool] = None use_speaker_boost: Optional[bool] = None
auto_mode: Optional[bool] = True
@model_validator(mode="after") @model_validator(mode="after")
def validate_voice_settings(self): def validate_voice_settings(self):
@@ -193,6 +194,7 @@ class ElevenLabsTTSService(WordTTSService):
"similarity_boost": params.similarity_boost, "similarity_boost": params.similarity_boost,
"style": params.style, "style": params.style,
"use_speaker_boost": params.use_speaker_boost, "use_speaker_boost": params.use_speaker_boost,
"auto_mode": str(params.auto_mode).lower(),
} }
self.set_model_name(model) self.set_model_name(model)
self.set_voice(voice_id) self.set_voice(voice_id)
@@ -312,7 +314,7 @@ class ElevenLabsTTSService(WordTTSService):
voice_id = self._voice_id voice_id = self._voice_id
model = self.model_name model = self.model_name
output_format = self._settings["output_format"] 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"]: if self._settings["optimize_streaming_latency"]:
url += f"&optimize_streaming_latency={self._settings['optimize_streaming_latency']}" url += f"&optimize_streaming_latency={self._settings['optimize_streaming_latency']}"