I have a problem with my microphone connectivity using Pycharm. I ran the below code on Spyder and terminal and they were fine. However, on Pycharm, it seemed run without error but just without result as well. I see that both my terminal and Spyder have access to microphone (system preferences -> security & privacy). If anyone knows how to trigger the system to allow microphone connectivity using Pycharm, any answers will be appreciated. Thanks!
I also tried to record my voice using pyaudio and that worked fine with Spyder and terminal, but no audio was recorded if using Pycharm (though the file was created).
simple code:
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("Speak")
audio = r.listen(source)
print("Stop")
try:
print("You said " + r.recognize_google(audio))
except:
pass