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

强颜欢笑 提交于 2019-11-28 05:34:44

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!