From 12b4a3b525d16105370d68f4bbb4d63f62f01d50 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 13 Sep 2024 18:16:23 -0700 Subject: [PATCH] Troubleshooting PlaybackThread init --- neon_audio/service.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/neon_audio/service.py b/neon_audio/service.py index 5510c4f..3aae4dd 100644 --- a/neon_audio/service.py +++ b/neon_audio/service.py @@ -87,13 +87,14 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error, bus = bus or get_messagebus() from neon_utils.signal_utils import create_signal - from neon_audio.tts.neon import NeonPlaybackThread - import ovos_audio.playback - ovos_audio.playback.PlaybackThread = NeonPlaybackThread - ovos_audio.service.PlaybackThread = NeonPlaybackThread PlaybackService.__init__(self, ready_hook, error_hook, stopping_hook, alive_hook, started_hook, watchdog, bus, disable_ocp, validate_source=False) + self.playback_thread.join() + del self.playback_thread + from neon_audio.tts.neon import NeonPlaybackThread + from ovos_plugin_manager.tts import TTS + self.playback_thread = NeonPlaybackThread(TTS.queue, self.bus) LOG.debug(f'Initialized tts={self._tts_hash} | ' f'fallback={self._fallback_tts_hash}') create_signal("neon_speak_api") # Create signal so skills use API @@ -181,3 +182,6 @@ def handle_get_tts(self, message): def init_messagebus(self): self.bus.on('neon.get_tts', self.handle_get_tts) PlaybackService.init_messagebus(self) + self.bus.remove("speak", PlaybackService.handle_speak) + self.bus.on("speak", self.handle_speak) + LOG.info("Initialized messagebus")