Am I doing the right thing to convert decibel from -120 - 0 to 0 - 120

后端 未结 5 1861
忘了有多久
忘了有多久 2020-12-23 23:47

I will like to measure the sound volume of the surrounding, not too sure if I am doing the right thing.

I will like to create a VU meter of a range of 0(quiet) to 12

5条回答
  •  悲哀的现实
    2020-12-24 00:23

    Actually, the range of decibels is from -160 to 0, but it can go to positive values.(AVAudioRecorder Class Reference - averagePowerForChannel: method)

    Then is better write db += 160; instead of db += 120;. Of course you can also put an offset to correct it.

提交回复
热议问题