From 3f4a1f854c8048168cce7489547a0846052bce38 Mon Sep 17 00:00:00 2001 From: Hugo <42470993+hugobloem@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:34:54 +0000 Subject: [PATCH] fix: use name of synthesize voice (#89) --- wyoming_microsoft_tts/handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wyoming_microsoft_tts/handler.py b/wyoming_microsoft_tts/handler.py index 22fa94d..3b20493 100755 --- a/wyoming_microsoft_tts/handler.py +++ b/wyoming_microsoft_tts/handler.py @@ -52,9 +52,11 @@ async def handle_event(self, event: Event) -> bool: # Join multiple lines text = " ".join(raw_text.strip().splitlines()) - voice = synthesize.voice - if voice is None: # Use default voice if not specified + + if synthesize.voice is None: # Use default voice if not specified voice = self.cli_args.voice + else: + voice = synthesize.voice.name if self.cli_args.auto_punctuation and text: # Add automatic punctuation (important for some voices)