Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Measuring decibels in iOS

Tags:

ios

swift

I am programming an application in Swift that needs to measure the decibels and I am using the averagePowerLevel property, but this property has a range of -160 to 0, if it exceeds the 0, it no longer measures it. Is there any property or way of measuring decibels that exceed that limit of 0? That is, can they be measured without any limit? Is there any reason why it can not be measured if it exceeds 0?

like image 551
nord81 Avatar asked Sep 10 '25 19:09

nord81


1 Answers

-160 to 0 represents the Range in Full Scale, which is also known as dbFS (db in Full Scale).

  • 0 dB in Full Scale maximum sound level a system can handle, beyond which the waveform is clipped.
  • -10 db in Full Scale, means -10 db in Full Scale means 10 db levels lower/quieter than the maximum sound level.
  • -160 db in Full Scale is the quietest sound difference the system can record.

And since averagePowerLevel is used to measure the level in Capture Channel, the system cannot create waveforms beyond 0 db in Full Scale, hence clips them. Thus, it makes sense that it does not measure beyond 0 db in Full Scale.

However for a Playing Channel, if the system is provided with level greater than 0 db in Full Scale, [AVAudioPlayer averagePowerForChannel], will return this value even though the system might play only at its maximum capable level which is at 0 db in Full Scale

like image 146
Libin Varghese Avatar answered Sep 13 '25 11:09

Libin Varghese