“dictado a texto” Código de respuesta

texto a voz

# 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

dictado a 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

Dictado a texto

<html>

</html>
Adventa Project

Respuestas similares a “dictado a texto”

Preguntas similares a “dictado a texto”

Más respuestas relacionadas con “dictado a texto” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código