I am using MediaRecorder
to try to create a sound meter which returns the Sound Pressure Level (what I believe most people mean when they refer to everyday volume in decibels).
Currently, I am using this implementation to get values in decibels:
return 20.0 * Math.log10(Math.abs(mMediaRecorder.getMaxAmplitude()) / 32768)
I'm not sure if this is correct. Sitting in a room with no noise other than a fan, it is returning values anywhere between -30 and -20. If I speak near the microphone, it jumps to values near -0.5 or so.
Reading many answers on this website, it seems that is is difficult and largely unreliable to measure SPL without calibrated devices. However, I don't need highly accurate results, only results applicable to everyday curiousity and non-extreme situations.
There are apps such as Sensor Box for Android, which seem to return decent results with no calibration needed to start. Using it in the same room, it is returning results between 40-60dB, and when I speak it jumps into the 80-90dB range.
How can I duplicate these results? Thank you!