3

I need to create an audio loudness (decibel) detector. To clarify, I am not trying to find the volume at which the iPhone is playing, but instead the volume of its surrounding in decibels. How can I do this?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179

2 Answers2

3

It can be done using AVAudioRecorder: http://b2cloud.com.au/tutorial/obtaining-decibels-from-the-ios-microphone

user293895
  • 1,465
  • 3
  • 22
  • 39
2

Use one of the Audio Queue or Audio Unit APIs to record low latency audio, run the samples through a DSP filter to weight the spectrum for the particular type or color of loudness you want to measure, then calibrate the mic on all the particular models of iOS devices you want to run your detector on against calibrated sound sources, perhaps in an anechoic chamber.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153