Question

I have used Android's audio recorder for my application to calculate the surrounding noise.

I got the maximum amplitude with the getMaxAmplitude() function and converted it to db using this formula :

db = 20 * Math.log10( getMaxAmplitude() / ref )

where ref=32767 (just a reference value)

But when I test the application in different devices the "db" is not the same.Which means the getMaxAmplitude() varies among devices.

If in sony tipo it shows -40db means in Samsung S4 its -20db.

Why this variation?

Was it helpful?

Solution

Different devices will have different microphones, with different sensitivities, and different audio hardware / preamps. Additionally, they may apply different input gain, EQ, and also automatic gain control (AGC) and noise reduction algorithms which may explain the big difference you are seeing.

On some devices you may be able to run AlsaMixer (as root) to control the microphone input gain.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top