-2

How can I get decibel by audio unit directly rather than calculate use formula ?

I found occur error when I use formula to get decibel. So I want to exchange method get decibel.

小东邪
  • 21
  • 5

2 Answers2

1

There is no iOS Audio Unit API that directly returns decibels. You have to calibrate each device and microphone against a known standard, and then adjust your formula to return the calibrated results. Then feed a suitably sized vector of frequency weighted raw audio samples from Audio Unit callback buffers to a amplitude measurement algorithm.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • I use audio unit but I find that sometime collect data is abnormal , It is normal when I use audio queue(-40 - 40). I find audio unit collect data on the formula is too large.So what should I do ? – 小东邪 Sep 30 '17 at 01:58
-1

The question is that I find audio unit data become abnormal from the data[512](the data size is 1024). So I don't handle these data and find the audio unit can work abnormality. Because we only use the data to calculate db.

小东邪
  • 21
  • 5