diff --git a/TTS/melo_handler.py b/TTS/melo_handler.py index b881d8258a59deb7cc26e874a3e199103c42db1e..0a86881d1fe5767c504165d7adf9d7ad59dfe040 100644 --- a/TTS/melo_handler.py +++ b/TTS/melo_handler.py @@ -54,7 +54,7 @@ class MeloTTSHandler(BaseHandler): def process(self, llm_sentence): language_id = None - + if isinstance(llm_sentence, tuple): print("llm sentence is tuple!") llm_sentence, language_id = llm_sentence @@ -62,6 +62,7 @@ class MeloTTSHandler(BaseHandler): console.print(f"[green]ASSISTANT: {llm_sentence}") if language_id is not None and self.language != language_id: + self.language = language_id self.model = TTS(language=WHISPER_LANGUAGE_TO_MELO_LANGUAGE[self.language], device=self.device) self.speaker_id = self.model.hps.data.spk2id[WHISPER_LANGUAGE_TO_MELO_SPEAKER[self.language]]