From 14bd3b1b32e4486a1eadf1d92e290916b20ef867 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 19 Jan 2026 09:19:57 -0500 Subject: [PATCH] Set Azure TTS default prosody rate to None --- src/pipecat/services/azure/tts.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pipecat/services/azure/tts.py b/src/pipecat/services/azure/tts.py index b9733db07..dc0c56e7b 100644 --- a/src/pipecat/services/azure/tts.py +++ b/src/pipecat/services/azure/tts.py @@ -90,7 +90,7 @@ class AzureBaseTTSService: emphasis: Emphasis level for speech ("strong", "moderate", "reduced"). language: Language for synthesis. Defaults to English (US). pitch: Voice pitch adjustment (e.g., "+10%", "-5Hz", "high"). - rate: Speech rate multiplier. Defaults to "1.05". + rate: Speech rate adjustment (e.g., "1.0", "1.25", "slow", "fast"). role: Voice role for expression (e.g., "YoungAdultFemale"). style: Speaking style (e.g., "cheerful", "sad", "excited"). style_degree: Intensity of the speaking style (0.01 to 2.0). @@ -100,7 +100,7 @@ class AzureBaseTTSService: emphasis: Optional[str] = None language: Optional[Language] = Language.EN_US pitch: Optional[str] = None - rate: Optional[str] = "1.05" + rate: Optional[str] = None role: Optional[str] = None style: Optional[str] = None style_degree: Optional[str] = None @@ -185,7 +185,9 @@ class AzureBaseTTSService: if self._settings["volume"]: prosody_attrs.append(f"volume='{self._settings['volume']}'") - ssml += f"" + # Only wrap in prosody tag if there are prosody attributes + if prosody_attrs: + ssml += f"" if self._settings["emphasis"]: ssml += f"" @@ -195,7 +197,8 @@ class AzureBaseTTSService: if self._settings["emphasis"]: ssml += "" - ssml += "" + if prosody_attrs: + ssml += "" if self._settings["style"]: ssml += ""