ElevenLabs: add support for a sample rate of 8000

This commit is contained in:
Aleix Conchillo Flaqué
2025-03-20 19:13:23 -07:00
parent d71b520153
commit fc78e6fc5a
2 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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(