Skip to content

Commit

Permalink
[BUGFIX] No blocking on event based TTS model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharrnah committed Feb 2, 2025
1 parent 689e531 commit 7e2b5b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,14 @@ async def custom_message_handler(server_instance, msg_obj, websocket):
# reload tts voices if tts model changed
if msg_obj["name"] == "tts_model":
print("Loading new TTS model. Please wait.")
tts.tts.load()
server_instance.broadcast_message(
json.dumps({"type": "available_tts_voices", "data": tts.tts.list_voices()}))
def tts_load():
if hasattr(tts.tts, 'load'):
tts.tts.load()
if hasattr(tts.tts, 'list_voices'):
server_instance.broadcast_message(
json.dumps({"type": "available_tts_voices", "data": tts.tts.list_voices()}))
tts_load = threading.Thread(target=tts_load)
tts_load.start()
if msg_obj["name"] == "osc_min_time_between_messages":
VRC_OSCLib.set_min_time_between_messages(msg_obj["value"])

Expand Down

0 comments on commit 7e2b5b8

Please sign in to comment.