1

My python version is 3.7 and Pyaudio version is 2.7 Program is totally running during engine init, but I can't use sipas5 for windows so I have used dummy

import pyttsx3
    engine = pyttsx3.init("dummy")
    voices = engine.getProperty('voices')
    engine.setProperty('voice', voices[0].id)

    def speak(text):
        print('Rex:' + text)
        engine.say(text)
        engine.runAndWait()

    print("On")
    speak("This program is running perfectly")
    print("End")

Output

On
Rex:This program is running perfectly
End

Process finished with exit code 0
Red
  • 26,798
  • 7
  • 36
  • 58
Hrithik Jaiswal
  • 74
  • 1
  • 2
  • 9

2 Answers2

0

Dummy isnt a voice engine. Its tk simply test. There are 3 types for pyttsx3. Sapi5, nsss, and espeak. This is what you put inside of that init (). This is the link for the official python package with information.

https://pypi.org/project/pyttsx3/

Redgar Tech
  • 347
  • 3
  • 13
-1

Literally just do it right pip3 install pyttxs3 = 2.71

  • 2
    Please do the markdown formatting right ( https://stackoverflow.com/editing-help ) and explain why this command helps. Also consider whether "Literally just do it right" might be perveived as a less friendly way of helping. (I intentionally chose the start of my comment to help you with that. Here is the missing helpful part: you will find a formatting to make code/commands easily recognisable as such. `this way` ) – Yunnosch Apr 21 '23 at 13:38