Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Haibane

macrumors newbie
Original poster
Jun 28, 2009
5
0
Hi everyone,

I've recently written an app which records sound using the new AVAudioRecorder class. The idea is that the app uses the microphone to listen to the environment and when the received sound's amplitude is above a given threshold then it records the actual time.

My problem is that the only method for that is audiometering using averagePower/maxPower which returns power in dB. However it is quite numb, meaning if it is above my threshold it just does not fall back instantly if the sound is gone but it will decay slowly instead giving "false alarms" until it goes below the threshold. I hope its understandable...

Does anybody have an idea how to mitigate this effect? (other method/class/etc)
 
If you are recording, you have the audio samples. You could calculate a running average of the sample amplitudes, or use a signal processing algorithm.
 
hmm that woul help, but how do I access the samples, could you please pinpont a class or example for me? Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.