Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
394 B
2
Indexable
Never
import pyttsx3


def speach_to_text(text):
    engine = pyttsx3.init()
    rate = engine.getProperty('rate')
    voices = engine.getProperty('voices')
    engine.setProperty('voice', voices[0].id)

    engine.setProperty('rate', rate)
    engine.say(phrase)
    engine.save_to_file(phrase, 'test.mp3')
    engine.runAndWait()


phrase = input('Write text to speach = > ')
speach_to_text(phrase)