speech_recognition
speech_recognition copied to clipboard
Help me to know why this voice recognition doesn't work for me, please :-(
Hello! I have tried various codes and none of them work. I have Linux Xubuntu, with Ubuntu 22.04.1 LTS and Python 3.10.6 I put one of the codes:
_import speech_recognition as sr
#_ Inicializamos el reconocedor de voz r = sr.Recognizer()
#_ Cargamos el archivo de audio with sr.AudioFile('audio.wav') as source: # Leemos el archivo de audio con el reconocedor audio = r.record(source)
#_ Intentamos reconocer lo que se ha dicho en el archivo de audio usando el reconocedor integrado try: text = r.recognize_sphinx(audio) print(f"El archivo de audio contiene: {text}") except sr.UnknownValueError: print("No se ha podido reconocer lo que hay en el archivo de audio") except sr.RequestError as e: print("Error al llamar al servicio de reconocimiento de voz")_
I say something to the microphone and the editor Thonny, he tells me this:
Audio file contains: hi
I don't understand the error! Note: "#_" It is so that I do not change the code to big bold