From b03563765fa41f090c61f268a9da0cfbb6c9afd1 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 7 Apr 2025 09:19:50 -0400 Subject: [PATCH] Fix: Set language for Azure TTS services --- CHANGELOG.md | 17 ++++++++++------- src/pipecat/services/azure/tts.py | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9532a8e02..af21e0bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,24 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Added new processors `ProducerProcessor` and `ConsumerProcessor`. The producer - processor processes frames from the pipeline and decides whether the consumers - should consume it or not. If so, the same frame that is received by the - producer is sent to the consumer. There can be multiple consumers per +- Added new processors `ProducerProcessor` and `ConsumerProcessor`. The + producer processor processes frames from the pipeline and decides whether the + consumers should consume it or not. If so, the same frame that is received by + the producer is sent to the consumer. There can be multiple consumers per producer. These processors can be useful to push frames from one part of a pipeline to a different one (e.g. when using `ParallelPipeline`). - Improvements for the `SmallWebRTCTransport`: - Wait until the pipeline is ready before triggering the `connected` event. - Queue messages if the data channel is not ready. - - Update the aiortc dependency to fix an issue where the 'video/rtx' MIME type - was incorrectly handled as a codec retransmission. + - Update the aiortc dependency to fix an issue where the 'video/rtx' MIME + type was incorrectly handled as a codec retransmission. - Avoid initial video delays. ### Fixed +- Fixed an issue in the Azure TTS services where the language was being set + incorrectly. + - Fixed `SmallWebRTCTransport` to support dynamic values for - `TransportParams.audio_out_10ms_chunks`. Previously, it only worked with 20ms + `TransportParams.audio_out_10ms_chunks`. Previously, it only worked with 20ms chunks. - Fixed an issue where `LLMAssistantContextAggregator` would prevent a diff --git a/src/pipecat/services/azure/tts.py b/src/pipecat/services/azure/tts.py index 141d59f5a..cf50c9fba 100644 --- a/src/pipecat/services/azure/tts.py +++ b/src/pipecat/services/azure/tts.py @@ -159,8 +159,8 @@ class AzureTTSService(AzureBaseTTSService): self._speech_config = SpeechConfig( subscription=self._api_key, region=self._region, - speech_recognition_language=self._settings["language"], ) + self._speech_config.speech_synthesis_language = self._settings["language"] self._speech_config.set_speech_synthesis_output_format( sample_rate_to_output_format(self.sample_rate) ) @@ -254,8 +254,8 @@ class AzureHttpTTSService(AzureBaseTTSService): self._speech_config = SpeechConfig( subscription=self._api_key, region=self._region, - speech_recognition_language=self._settings["language"], ) + self._speech_config.speech_synthesis_language = self._settings["language"] self._speech_config.set_speech_synthesis_output_format( sample_rate_to_output_format(self.sample_rate) )