AI speech code stopping after the first speech command

I’m looking at the pyttsx3 documentation, and it appears to rely on built in speech synthesizers on Windows and Mac to produce the voice. This might be part of the issue. I would also mention that this probably makes this app non-functional on a mobile device without a speech synthesizer.

It appears that you are able to export speech to an audio file with pyttsx3. I would recommend that on your uplink server you convert the synthesized speech to an audio file, which is then returned to the app. The app can then play the audio file in the browser.

Here is a SO thread on saving pyttsx3 speech to a file: https://stackoverflow.com/questions/53935096/how-can-i-convert-a-text-file-to-mp3-file-using-python-pyttsx3-and-sapi5

And here is an example of playing a sound on click: Play sound when called

1 Like