Skip to content

Commit

Permalink
fix:improve stop
Browse files Browse the repository at this point in the history
also stop ongoing TTS

partial fix, TODO in code for later
  • Loading branch information
JarbasAl committed Oct 21, 2024
1 parent 9ab925c commit 46e8bb2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,12 @@ def _handle_session_stop(self, message: Message):
except Exception as e:
data["error"] = str(e)
self.log.exception(f'Failed to stop skill: {self.skill_id}: {e}')
if data["result"] and sess.session_id == "default":
# TODO - track if speech is coming from this skill!
# this is not currently tracked
self.bus.emit(message.reply("mycroft.audio.speech.stop",
{"skill_id": self.skill_id}))

self.bus.emit(message.reply(f"{self.skill_id}.stop.response", data))

def __handle_stop(self, message):
Expand All @@ -1247,7 +1253,7 @@ def __handle_stop(self, message):
self.bus.emit(message.forward(self.skill_id + ".stop"))
sess = SessionManager.get(message)
try:
stopped = self.stop_session(sess) or self.stop()
stopped = self.stop_session(sess) or self.stop() or False
LOG.debug(f"{self.skill_id} stopped: {stopped}")
if stopped:
self.bus.emit(message.reply("mycroft.stop.handled",
Expand Down

0 comments on commit 46e8bb2

Please sign in to comment.