pyttsx3 icon indicating copy to clipboard operation
pyttsx3 copied to clipboard

Infinite Looping in startLoop sapi5.py

Open MikeKadoshnikov opened this issue 3 months ago • 1 comments

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. pyttsx3issue

MikeKadoshnikov avatar Mar 31 '24 20:03 MikeKadoshnikov

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

MikeKadoshnikov avatar Mar 31 '24 22:03 MikeKadoshnikov