Skip to content

Commit

Permalink
fix:wait while speaking (#238)
Browse files Browse the repository at this point in the history
* fix:wait while speaking

didnt realize bools were considered a type of int

```
isinstance(True, int)
True
isinstance(False, int)
True
```

* fix:wait while speaking

didnt realize bools were considered a type of int

```
isinstance(True, int)
True
isinstance(False, int)
True
```
  • Loading branch information
JarbasAl authored Sep 23, 2024
1 parent e4b1677 commit ae5ef64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ def speak(self, utterance: str, expect_response: bool = False,
self.bus.emit(m)

if wait:
timeout = wait if isinstance(wait, int) else 15
timeout = 15 if isinstance(wait, bool) else wait
sess = SessionManager.get(m)
sess.is_speaking = True
SessionManager.wait_while_speaking(timeout, sess)
Expand Down Expand Up @@ -1724,7 +1724,7 @@ def _play_audio_old(self, filename: str, instant: bool = False,
"uri": filename # new namespace
}))
if wait:
timeout = wait if isinstance(wait, int) else 30
timeout = 30 if isinstance(wait, bool) else wait
sess = SessionManager.get(message)
sess.is_speaking = True
SessionManager.wait_while_speaking(timeout, sess)
Expand Down Expand Up @@ -1769,7 +1769,7 @@ def play_audio(self, filename: str, instant: bool = False,

self.bus.emit(message.forward(mtype, data))
if wait:
timeout = wait if isinstance(wait, int) else 30
timeout = 30 if isinstance(wait, bool) else wait
sess = SessionManager.get(message)
sess.is_speaking = True
SessionManager.wait_while_speaking(timeout, sess)
Expand Down

0 comments on commit ae5ef64

Please sign in to comment.