Text To Voice Using Python
Text To Voice Using Python code mport pyttsx3 import datetime engine = pyttsx3.init( 'sapi5' ) voices = engine.getProperty( 'voices' ) engine.setProperty( 'voices' , voices[ 0 ].id) def speak ( audio ): engine.say(audio) engine.runAndWait() def wishme (): hour = int (datetime.datetime.now().hour) if hour>= 0 and hour< 12 : speak( "good morning" ) elif hour>= 12 and hour<= 18 : speak( "good afternoon" ) else : speak( "good evening" ) speak( "hi mehul i am your assistant. how are you" ) ...


Comments
Post a Comment