Merge pull request #2862 from pipecat-ai/mb/11labs-http-aggregate-sentences

Add aggregate_sentences arg to ElevenLabsHttpTTSService
This commit is contained in:
Mark Backman
2025-10-15 12:54:23 -04:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added an `aggregate_sentences` arg in `ElevenLabsHttpTTSService`, where the
default value is True.
- The runner `--folder` argument now supports downloading files from - The runner `--folder` argument now supports downloading files from
subdirectories. subdirectories.

View File

@@ -774,6 +774,7 @@ class ElevenLabsHttpTTSService(WordTTSService):
base_url: str = "https://api.elevenlabs.io", base_url: str = "https://api.elevenlabs.io",
sample_rate: Optional[int] = None, sample_rate: Optional[int] = None,
params: Optional[InputParams] = None, params: Optional[InputParams] = None,
aggregate_sentences: Optional[bool] = True,
**kwargs, **kwargs,
): ):
"""Initialize the ElevenLabs HTTP TTS service. """Initialize the ElevenLabs HTTP TTS service.
@@ -786,10 +787,11 @@ class ElevenLabsHttpTTSService(WordTTSService):
base_url: Base URL for ElevenLabs HTTP API. base_url: Base URL for ElevenLabs HTTP API.
sample_rate: Audio sample rate. If None, uses default. sample_rate: Audio sample rate. If None, uses default.
params: Additional input parameters for voice customization. params: Additional input parameters for voice customization.
aggregate_sentences: Whether to aggregate sentences within the TTSService.
**kwargs: Additional arguments passed to the parent service. **kwargs: Additional arguments passed to the parent service.
""" """
super().__init__( super().__init__(
aggregate_sentences=True, aggregate_sentences=aggregate_sentences,
push_text_frames=False, push_text_frames=False,
push_stop_frames=True, push_stop_frames=True,
sample_rate=sample_rate, sample_rate=sample_rate,