2

I am using python 3.10 and PYTTSX3 2.9 to convert a text into an audio file. I start with a very basic code:

import pyttsx3
engine = pyttsx3.init()
engine.say("Hello, this is a sample text to speech conversion.")
engine.runAndWait()
engine.say("This is a test to see if the second code works.")
engine.runAndWait()

From the code I should hear two texts, but after hearing "Hello, this is a sample text to speech conversion." the code stops and the kernel dies.

Any help would be much appreciated! Thanks in advance :)

David Lee
  • 43
  • 6

1 Answers1

0

I really wish this could be a comment, but I do not have the reputation so here it is:

Have a look at this thread looks like a simular problem to yours. Sounds like you may need to install pyaudio.

Simular Question

Jaxsonpd
  • 62
  • 9
  • Thank you for your comment! I tried it but the problem persists :( I tried the other methods as well but none of them work. Either way thanks for the information, I appreciate it! – David Lee Jun 11 '23 at 04:44
  • No problem good luck with your search! – Jaxsonpd Jun 12 '23 at 04:19