Fix: Set language for Azure TTS services

This commit is contained in:
Mark Backman
2025-04-07 09:19:50 -04:00
parent 6466573b84
commit b03563765f
2 changed files with 12 additions and 9 deletions

View File

@@ -9,24 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added new processors `ProducerProcessor` and `ConsumerProcessor`. The producer - Added new processors `ProducerProcessor` and `ConsumerProcessor`. The
processor processes frames from the pipeline and decides whether the consumers producer processor processes frames from the pipeline and decides whether the
should consume it or not. If so, the same frame that is received by the consumers should consume it or not. If so, the same frame that is received by
producer is sent to the consumer. There can be multiple consumers per 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 producer. These processors can be useful to push frames from one part of a
pipeline to a different one (e.g. when using `ParallelPipeline`). pipeline to a different one (e.g. when using `ParallelPipeline`).
- Improvements for the `SmallWebRTCTransport`: - Improvements for the `SmallWebRTCTransport`:
- Wait until the pipeline is ready before triggering the `connected` event. - Wait until the pipeline is ready before triggering the `connected` event.
- Queue messages if the data channel is not ready. - Queue messages if the data channel is not ready.
- Update the aiortc dependency to fix an issue where the 'video/rtx' MIME type - Update the aiortc dependency to fix an issue where the 'video/rtx' MIME
was incorrectly handled as a codec retransmission. type was incorrectly handled as a codec retransmission.
- Avoid initial video delays. - Avoid initial video delays.
### Fixed ### Fixed
- Fixed an issue in the Azure TTS services where the language was being set
incorrectly.
- Fixed `SmallWebRTCTransport` to support dynamic values for - 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. chunks.
- Fixed an issue where `LLMAssistantContextAggregator` would prevent a - Fixed an issue where `LLMAssistantContextAggregator` would prevent a

View File

@@ -159,8 +159,8 @@ class AzureTTSService(AzureBaseTTSService):
self._speech_config = SpeechConfig( self._speech_config = SpeechConfig(
subscription=self._api_key, subscription=self._api_key,
region=self._region, 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( self._speech_config.set_speech_synthesis_output_format(
sample_rate_to_output_format(self.sample_rate) sample_rate_to_output_format(self.sample_rate)
) )
@@ -254,8 +254,8 @@ class AzureHttpTTSService(AzureBaseTTSService):
self._speech_config = SpeechConfig( self._speech_config = SpeechConfig(
subscription=self._api_key, subscription=self._api_key,
region=self._region, 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( self._speech_config.set_speech_synthesis_output_format(
sample_rate_to_output_format(self.sample_rate) sample_rate_to_output_format(self.sample_rate)
) )