Skip to content

Commit

Permalink
Fix automatic tts not starting with avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoCaracciolo committed Dec 7, 2024
1 parent a217d35 commit 23980a5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,18 +1431,18 @@ def send_message(self):
if self.translation_enabled and self.translation_handler in AVAILABLE_TRANSLATORS:
translator = AVAILABLE_TRANSLATORS[self.translation_handler]["class"](self.settings, self.directory)
if self.avatar_enabled and self.avatar_handler is not None:
self.avatar_handler.speak_with_tts(message, self.tts, translator)
tts_thread = threading.Thread(target=self.avatar_handler.speak_with_tts, args=(message, self.tts, translator))
else:
if translator is not None:
message = translator.translate(message)
tts_thread = threading.Thread(target=self.tts.play_audio, args=(message, ))
tts_thread.start()
def restart_recording():
if tts_thread is not None:
tts_thread.join()
GLib.idle_add(self.start_recording, self.recording_button)
if self.automatic_stt:
threading.Thread(target=restart_recording).start()
tts_thread.start()
def restart_recording():
if tts_thread is not None:
tts_thread.join()
GLib.idle_add(self.start_recording, self.recording_button)
if self.automatic_stt:
threading.Thread(target=restart_recording).start()


def create_streaming_message_label(self):
Expand Down

0 comments on commit 23980a5

Please sign in to comment.