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

后端 未结 5 1839
忘了有多久
忘了有多久 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:25

    I make a regression model to convert the mapping relation between the wav data generated from NSRecorder and the decibel data from NSRecorder.averagePowerForChannel

    NSRecorder.averagePowerForChannel (dB) = -80+6 log2(wav_RMS)

    Where wav_RMS is root mean square value of wav data in a short time, i.e. 0.1 sec.

提交回复
热议问题