Skip to content

Commit

Permalink
fix:troubleshoot wait_while_speaking
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 23, 2024
1 parent 893ee2e commit cad26ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ovos_bus_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,12 @@ def wait_while_speaking(cls, timeout=15, session: Session = None):
session = session or SessionManager.get()
if not cls.is_speaking(session):
LOG.warning(f"can't 'wait_while_speaking' because "
f"session {session.session_id} is not currently speaking")
f"session '{session.session_id}' is not currently speaking")
return

# wait until end of speech

LOG.debug(f"waiting for session: {session.session_id} audio output to end")
LOG.debug(f"waiting for session '{session.session_id}' audio output to end with timeout: {timeout}")
event = Event()
sessid = session.session_id

Expand All @@ -657,7 +657,8 @@ def handle_output_end(msg):

cls.bus.on("recognizer_loop:audio_output_end", handle_output_end)
event.wait(timeout=timeout)
LOG.debug(f"no longer waiting for session: {session.session_id} audio output state change")
if not event.is_set():
LOG.warning("waiting for audio output end timed out! not waiting anymore")
cls.bus.remove("recognizer_loop:audio_output_end", handle_output_end)

@classmethod
Expand Down

0 comments on commit cad26ac

Please sign in to comment.