diff --git a/CHANGELOG.md b/CHANGELOG.md index 701b8a81c..c79c8f3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- ElevenLabs TTS services now support a sample rate of 8000. + ### Fixed - Fixed an issue in `UltravoxSTTService` that caused improper audio processing diff --git a/dev-requirements.txt b/dev-requirements.txt index 2b55adcbe..e65c2755c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,10 +3,10 @@ coverage~=7.6.12 grpcio-tools~=1.67.1 pip-tools~=7.4.1 pre-commit~=4.0.1 -pyright~=1.1.394 +pyright~=1.1.397 pytest~=8.3.4 pytest-asyncio~=0.25.3 -ruff~=0.9.7 +ruff~=0.11.1 setuptools~=70.0.0 setuptools_scm~=8.1.0 python-dotenv~=1.0.1 diff --git a/src/pipecat/services/elevenlabs.py b/src/pipecat/services/elevenlabs.py index 568b9eb64..68c71a144 100644 --- a/src/pipecat/services/elevenlabs.py +++ b/src/pipecat/services/elevenlabs.py @@ -102,6 +102,8 @@ def language_to_elevenlabs_language(language: Language) -> Optional[str]: def output_format_from_sample_rate(sample_rate: int) -> str: match sample_rate: + case 8000: + return "pcm_8000" case 16000: return "pcm_16000" case 22050: @@ -113,7 +115,7 @@ def output_format_from_sample_rate(sample_rate: int) -> str: logger.warning( f"ElevenLabsTTSService: No output format available for {sample_rate} sample rate" ) - return "pcm_16000" + return "pcm_24000" def build_elevenlabs_voice_settings( diff --git a/src/pipecat/services/ultravox.py b/src/pipecat/services/ultravox.py index a17ee3e85..52a5d05eb 100644 --- a/src/pipecat/services/ultravox.py +++ b/src/pipecat/services/ultravox.py @@ -17,25 +17,19 @@ from loguru import logger from pipecat.frames.frames import ( AudioRawFrame, - LLMFullResponseEndFrame, - LLMFullResponseStartFrame, - LLMTextFrame, - TranscriptionFrame, - TextFrame, - StartFrame, - EndFrame, CancelFrame, EndFrame, ErrorFrame, Frame, + LLMFullResponseEndFrame, + LLMFullResponseStartFrame, + LLMTextFrame, StartFrame, - TranscriptionFrame, UserStartedSpeakingFrame, UserStoppedSpeakingFrame, ) from pipecat.processors.frame_processor import FrameDirection from pipecat.services.ai_services import AIService -from pipecat.utils.time import time_now_iso8601 try: from transformers import AutoTokenizer