pythontext-to-speechspeech

How to convert text to speech in python


I would like to now how to convert text to speech in python.

In .NET i used

Dim SAPI

Msg = 'Hi this is a test'

SAPI = CreateObject("sapi.spvoice")
SAPI.Speak(Msg)

Solution

  • You can achieve it by pyttsx module. it uses default MS speech recognition system.

    import pyttsx
    
    engine = pyttsx.init()
    engine.say("Your Message")
    engine.runAndWait()