whisper_mic
whisper_mic copied to clipboard
Adjusting for ambient Noise missing.
You might want to add this line after with sr.Microphone as source
r.adjust_for_ambient_noise(source, duration = 1)
Wasn't recording for me till I added this. Windows btw.
It fixed the issue for you, but what does it do?
I read it on this website. it explains what setting dynamic energy to true and using adjust for ambient does. according to this person, Using both together gives better results. so I tried it and it worked. I kinda don't understand why, Since dynamic energy adjusts the value constantly, while adjust for ambient does it once. so It Should be fine with just using dynamic energy in theory.
https://www.codesofinterest.com/2017/04/energy-threshold-calibration-in-speech-recognition.html
Tried this too and the accuracy seems to have improved significantly. Thanks for sharing
It does seem to make it better ill try to do some testing to see how it reacts when you move from environment to environment and if it needs re calibration
This is now done in the code.