0
Hello I have an error that it displays the message but not what I said
main.py
Ouvindo....
Você disse {'alternative': [{'transcript': 'você disse', 'confidence': 0.88387161}, {'transcript': 'você diz'}, {'transcript': 'e você disse'}, {'transcript': 'se você diz'}, {'transcript': 'você diz isso'}], 'final': True}
main.py
Ouvindo....
Você disse []
python code:
import speech_recognition as sr
def reconhecer():
rec = sr.Recognizer()
with sr.Microphone() as s:
rec.adjust_for_ambient_noise(s)
while True:
try:
audio = rec.listen(s)
entrada = rec.recognize_google(audio, language="pt-PT", show_all=True)
return "Você disse {}".format(entrada)
except sr.UnknownValueError:
return "Nao estou te entendendo"
print("Ouvindo.....")
fala = reconhecer()
print(fala)
what I said on the microphone he puts only []
– Leo Burik
Yes, because what he returns is a dictionary of all the options he has identified and the level of trust. If you want to display only the text you will need to access this value in the dictionary.
– Woss
then I change the show_all ? and I’m starting now in python
– Leo Burik
If you are starting in python the ideal is to start with the same simple. Learning the language and programming principles first and then applying them in a specific context. You’re trying to drive a formula one without ever having taken a car.
– Isac