whisper_mic icon indicating copy to clipboard operation
whisper_mic copied to clipboard

Adjusting for ambient Noise missing.

Open AryanEmbered opened this issue 2 years ago • 4 comments

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.

AryanEmbered avatar Oct 09 '22 09:10 AryanEmbered

It fixed the issue for you, but what does it do?

mallorbc avatar Oct 13 '22 03:10 mallorbc

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

AryanEmbered avatar Oct 13 '22 13:10 AryanEmbered

Tried this too and the accuracy seems to have improved significantly. Thanks for sharing

SunnyOd avatar Oct 17 '22 11:10 SunnyOd

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

DevenBL avatar Feb 04 '23 15:02 DevenBL

This is now done in the code.

mallorbc avatar Jul 04 '24 07:07 mallorbc