import speech_recognition as sr
r = sr.Recognizer()
print(“Saying something and I will print it.”)
with sr.Microphone() as source:
audio = r.listen(source)
text = r.recognize_google(audio)
This code work in Jupyter Notebook and Terminal, but not in sublime text. I think this is cause by sublime text can’t use microphone. Am I right? I hope someone can help me.