“Discurso para texto” Respostas de código

texto para fala

# Import the required module for text
# to speech conversion
from gtts import gTTS

# This module is imported so that we can
# play the converted audio

mytext = input("Enter the text to be converted: ")

language = 'en'



myobj = gTTS(text=mytext, lang=language, slow=False)

E = input("Enter the name of the file: ")

myobj.save(E + ".mp3")
#you can change mp3 to wav
cool dude

discurso para texto

import speech_recognition as sr
import pyttsx3

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
# print(voices[1].id)
engine.setProperty('voice', voices[0].id)


def speak(audio):
    engine.say(audio)
    engine.runAndWait()

r = sr.Recognizer()

with sr.Microphone() as source:
    print("Speak anything")
    speak("Speak anything")
    audio = r.listen(source)

try:
    text = r.recognize_google(audio)
    print("you said : {}".format(text))
    speak("you said : {}".format(text))

except:
 print("Sorry could not recognize your voice")
 speak("Sorry could not recognize your voice")
Coding boy Hasya

Discurso para texto

<html>

</html>
Adventa Project

Respostas semelhantes a “Discurso para texto”

Perguntas semelhantes a “Discurso para texto”

Mais respostas relacionadas para “Discurso para texto” em HTML

Procure respostas de código populares por idioma

Procurar outros idiomas de código