'I try to use speech_recognition but my code can't run

import speech_recognition

robot_ear = speech_recognition.Recognizer()
with speech_recognition.Microphone() as mic:
    print("Robot: I'm listening")
    audio = robot_ear.listen(mic)
try:
    you = robot_ear.record(mic, duration=3)
except:
    you == ""
print(you)

Robot: I'm listening Traceback (most recent call last): File "C:\Users\Zit\PycharmProjects\pythonProject1\venv\include\speech.py", line 6, in audio = robot_ear.listen(mic)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source