You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this package in a Robotics project, we have a function for speaking below:
def say(self, text):
self.face.set_robot_state("talking")
if (self.voice._inLoop):
self.voice.endLoop()
self.voice.say(text)
self.voice.runAndWait()
self.face.set_robot_state("idle")
and the runAndWait() function ends up running into an infinite loop. Going through PyCharm debugging I have narrowed it down to sapi5.py where it is getting stuck in startLoop(self) and looking at the code it is not obvious how this while loop is supposed to stop. Haven"t found any resources on circumventing this issue, as its unfortunate since we wanted to use this package for our assignments, we will have to look for an alternative.
The text was updated successfully, but these errors were encountered:
Found a way to have it not infinite loop but it requires us to initialize pyttsx3 every time we want the robot to say something, although it works it seems somewhat resource intensive since we have to reinitialize it everytime
Unfortunately we do not have access to the exact system we tested on. Although this issue primarily showed up on a raspberry pi 4, I believe we narrowed the issue down to global initialization with threading, somehow with the threading we couldn"t reach the global engine. The solution was to initialize it every time we needed speech, and that seemed to work alright for what we needed it to do.
Using this package in a Robotics project, we have a function for speaking below:
def say(self, text):
self.face.set_robot_state("talking")
if (self.voice._inLoop):
self.voice.endLoop()
self.voice.say(text)
self.voice.runAndWait()
self.face.set_robot_state("idle")
and the runAndWait() function ends up running into an infinite loop. Going through PyCharm debugging I have narrowed it down to sapi5.py where it is getting stuck in startLoop(self) and looking at the code it is not obvious how this while loop is supposed to stop. Haven"t found any resources on circumventing this issue, as its unfortunate since we wanted to use this package for our assignments, we will have to look for an alternative.
The text was updated successfully, but these errors were encountered: