Fixed a type error when using voice_settings in ElevenLabsHttpTTSService

This commit is contained in:
Mark Backman
2025-01-20 07:57:02 -05:00
parent a169e0cde9
commit 262d3a19c9
2 changed files with 8 additions and 2 deletions

View File

@@ -5,6 +5,12 @@ All notable changes to **Pipecat** will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed a type error when using `voice_settings` in `ElevenLabsHttpTTSService`.
## [0.0.53] - 2025-01-18
### Added

View File

@@ -524,13 +524,13 @@ class ElevenLabsHttpTTSService(TTSService):
url = f"{self._base_url}/v1/text-to-speech/{self._voice_id}/stream"
payload = {
payload: Dict[str, Union[str, Dict[str, Union[float, bool]]]] = {
"text": text,
"model_id": self._model_name,
}
if self._voice_settings:
payload["voice_settings"] = json.dumps(self._voice_settings)
payload["voice_settings"] = self._voice_settings
if self._settings["language"]:
payload["language_code"] = self._settings["language"]