Reconocimiento por voz en Python (Código)

Este código de reconocimiento por voz en Python, te permite mandar órdenes a un determinado software mediante la voz. También es posible que se pueda utilizar para otros casos, como por ejemplo para software espía o para el desarrollo de software para domótica y electrónica. Combiando también con otros códigos de reconocimiento del lenguaje natural y resumen de textos, podría utilizarse también para publicidad con poca ética.

Antes de tener este código gratis por la cara, sígueme:
🟣Instagramhttps://www.instagram.com/javierfinance/
🔵Twitterhttps://twitter.com/JavierFinance


#pip install pipwin
#pip install speechrecognition 
#pip install --upgrade speechrecognition
import webbrowser
import speech_recognition as sr
r = sr.Recognizer() 
while True:
    with sr.Microphone() as source:
        print('Hola, soy tu asistente por voz: ')
        audio = r.listen(source)
 
        try:
            text = r.recognize_google(audio)
            print('Has dicho: {}'.format(text))
            print(text)
            if "Amazon" in text:
                webbrowser.open('http://amazon.es')
            if "noticias" in text:
                webbrowser.open('http://noticiasfinancieras.info')
            if "que tal" in text:
                print("Bien y tu?")
        except:
            print('No te he entendido')
 

boton entrar

Javier Finance
Sígueme:
Últimas entradas de Javier Finance (ver todo)

Deja un comentario