Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix/avoid_c++_crash #76

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ovos_bus_client/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ovos_bus_client import MessageBusClient, Message
from ovos_config import Configuration
import sys
import time


def ovos_speak():
Expand All @@ -22,6 +23,7 @@ def ovos_speak():
if not client.connected_event.is_set():
client.connected_event.wait()
client.emit(Message("speak", {"utterance": utt, "lang": lang}))
time.sleep(0.5) # avoids crash in c++ bus server
client.close()


Expand All @@ -41,6 +43,7 @@ def ovos_say_to():
if not client.connected_event.is_set():
client.connected_event.wait()
client.emit(Message("recognizer_loop:utterance", {"utterances": [utt], "lang": lang}))
time.sleep(0.5) # avoids crash in c++ bus server
client.close()


Expand All @@ -50,6 +53,7 @@ def ovos_listen():
if not client.connected_event.is_set():
client.connected_event.wait()
client.emit(Message("mycroft.mic.listen"))
time.sleep(0.5) # avoids crash in c++ bus server
client.close()


Expand Down Expand Up @@ -80,11 +84,12 @@ def simple_cli():
client.emit(Message("recognizer_loop:utterance",
{"utterances": [utt], "lang": lang},
{"session": sess.serialize()}))
time.sleep(0.5) # avoids crash in c++ bus server
except KeyboardInterrupt:
break

client.close()


if __name__ == "__main__":
simple_cli()
simple_cli()
Loading