Answers for "text to speech"

1

python speech to text

import speech_recognition as sr


        def main():

            r = sr.Recognizer()

            with sr.Microphone() as source:
                r.adjust_for_ambient_noise(source)

                audio = r.listen(source)

                try:

                    print(r.recognize_google(audio))

                except Exception as e:
                    print("Error :  " + str(e))


                with open("recorded.wav", "wb") as f:
                    f.write(audio.get_wav_data())


        if __name__ == "__main__":
            main()
Posted by: Guest on October-04-2020
15

text to speech

import pyttsx3
engine = pyttsx3.init()
engine.say("")
engine.runAndWait()
Posted by: Guest on November-04-2020
1

text to speech

mshta vbscript:Execute("CreateObject(""SAPI.SpVoice"").Speak(""Hello"")(window.close)")
Posted by: Guest on September-24-2021
1

text to speech online

import pyttsx3

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# you can use print(voices) to see how many voices you have installed
# print(voices[0].id)
# print(voices[1].id)
# print(voices[2].id)
print(voices)
engine.setProperty('voices', voices[0].id)

def speak(audio):
  	print(audio)
    engine.say(audio)
    engine.runAndWait()
    
speak('Hello')

# prints hello and says it
Posted by: Guest on February-21-2021

Browse Popular Code Answers by Language