mic sensing is too "numb"

Discussion in 'iOS Programming' started by Haibane, Jul 21, 2009.

  1. Haibane macrumors newbie

    Jun 28, 2009
    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)
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    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.
  3. Haibane thread starter macrumors newbie

    Jun 28, 2009
    hmm that woul help, but how do I access the samples, could you please pinpont a class or example for me? Thanks

Share This Page