I am trying to detect when the user is blowing into the mic of an iPhone. Right now I am using the SCListener class from Stephen Celis to call
if ([[SCListener sharedListener] peakPower] > 0.99)
in an NSTimer. However, this returns true sometimes when I’m not blowing. Anyone have any sample code to check if the user is blowing into the mic?
I would recommend low-pass filtering the power signal first. There is always going to be some amount of transient noise that will mess with instantaneous readings; low-pass filtering helps mitigate that. A nice and easy low-pass filter would be something like this: