Added support for Google Journey TTS voices

This commit is contained in:
Mark Backman
2025-01-06 14:54:34 -05:00
parent a1377b7f1a
commit 3e1ec4a8ee
3 changed files with 17 additions and 7 deletions

View File

@@ -865,8 +865,15 @@ class GoogleTTSService(TTSService):
try:
await self.start_ttfb_metrics()
ssml = self._construct_ssml(text)
synthesis_input = texttospeech_v1.SynthesisInput(ssml=ssml)
is_journey_voice = "journey" in self._voice_id.lower()
# Create synthesis input based on voice_id
if is_journey_voice:
synthesis_input = texttospeech_v1.SynthesisInput(text=text)
else:
ssml = self._construct_ssml(text)
synthesis_input = texttospeech_v1.SynthesisInput(ssml=ssml)
voice = texttospeech_v1.VoiceSelectionParams(
language_code=self._settings["language"], name=self._voice_id
)