From df9b2863f04cfb6366bfaa0677f1ee0b7fc87350 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:56:20 +0100 Subject: [PATCH 1/3] troubleshoot issues around wait_while_speaking (#121) --- ovos_bus_client/session.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ovos_bus_client/session.py b/ovos_bus_client/session.py index 163d0f3..7bf2baa 100644 --- a/ovos_bus_client/session.py +++ b/ovos_bus_client/session.py @@ -626,15 +626,23 @@ def is_speaking(cls, session: Session = None): @classmethod def wait_while_speaking(cls, timeout=15, session: Session = None): """ wait until audio service reports end of audio output """ + if isinstance(timeout, bool): + LOG.warning(f"expected timeout in seconds, got boolean '{timeout}', " + f"defaulting to 15 seconds") + timeout = 15 + if not cls.bus: LOG.error("SessionManager not connected to bus, can not monitor speech state") return 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") return # wait until end of speech + LOG.debug(f"waiting for session '{session.session_id}' audio output to end with timeout: {timeout}") event = Event() sessid = session.session_id @@ -642,10 +650,13 @@ def handle_output_end(msg): nonlocal sessid, event sess = SessionManager.get(msg) if sessid == sess.session_id: + LOG.debug(f"session: {sessid} audio output ended") event.set() cls.bus.on("recognizer_loop:audio_output_end", handle_output_end) event.wait(timeout=timeout) + 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 From e0dde8a68317ac9b24e32d0a0e3c81b8e040de47 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 23 Sep 2024 16:56:36 +0000 Subject: [PATCH 2/3] Increment Version to 0.1.1a1 --- ovos_bus_client/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_bus_client/version.py b/ovos_bus_client/version.py index cbb1e3f..8a891f2 100644 --- a/ovos_bus_client/version.py +++ b/ovos_bus_client/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 1 -VERSION_BUILD = 0 -VERSION_ALPHA = 0 +VERSION_BUILD = 1 +VERSION_ALPHA = 1 # END_VERSION_BLOCK From 2b847f4348b99a3bddc1d3201bde03a219d5eb1d Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 23 Sep 2024 16:57:00 +0000 Subject: [PATCH 3/3] Update Changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37083ca..9773c4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ # Changelog -## [0.1.0a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.1.0a1) (2024-09-17) +## [0.1.1a1](https://github.com/OpenVoiceOS/ovos-bus-client/tree/0.1.1a1) (2024-09-23) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.0.10...0.1.0a1) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-bus-client/compare/0.1.0...0.1.1a1) **Merged pull requests:** -- feat:ovos.common\_play.search.populate event [\#118](https://github.com/OpenVoiceOS/ovos-bus-client/pull/118) ([JarbasAl](https://github.com/JarbasAl)) +- troubleshoot issues around wait\_while\_speaking [\#121](https://github.com/OpenVoiceOS/ovos-bus-client/pull/121) ([JarbasAl](https://github.com/JarbasAl))