Try using AudioRecord to record audio into the buffer, then measure dB from raw PCM data.
To initialize AudioRecord
AudioRecord record = new AudioRecord(AudioSource.MIC, SAMPLING_RATE, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);
To read a sample from MIC
short[] buff = new short[8000]; record.read(buff, 0, buff.length);
DMK
source share