I want to measure sound in dB(A) in iPhone.
How can I do it?
Is there any example or tutorial?
Thanks to modern technology, your smartphone can measure decibels to determine if your environment exposes you to harmful noises that may cause permanent or temporary noise-induced hearing loss (NIHL).
With a free app and your Android phone, you can turn your phone into a noise meter and find out. Download Sound Meter from the Android Market and launch the app. It starts right up to the sound meter and measures the minimum, mean, and maximum ambient sound levels in decibels (dB).
The Noise app on Apple Watch SE and Apple Watch Series 4 and later measures the ambient sound levels in your environment using the microphone and duration of exposure. When Apple Watch detects that the decibel level has risen to a point where hearing could be affected, it can notify you with a tap on the wrist.
If you use AVAudioPlayer, you can use this method
AVAudioPlayer *avPlayer = ...
[avPlayer play...];
[avPlayer averagePowerForChannel:0];
[avPlayer averagePowerForChannel:1];
From Apple's doc
- (float)averagePowerForChannel:(NSUInteger)channelNumber
Description
Returns the average power for a given channel, in decibels, for the sound being played.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With