Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to measure noise or sound and displays in dB(A) in iphone?

I want to measure sound in dB(A) in iPhone.

How can I do it?

Is there any example or tutorial?

like image 654
Mitul Nakum Avatar asked May 31 '11 06:05

Mitul Nakum


People also ask

Can you measure dB with phone?

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).

How do I find the sound dB on my phone?

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).

How does Apple measure 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.


1 Answers

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.

like image 76
tuoxie007 Avatar answered Oct 11 '22 04:10

tuoxie007