Skip to content Skip to sidebar Skip to footer

Sound Meter Android

I'm trying to implement a sound meter in dB in android but I haven't found the way to start yet. I have gone over androids API and haven't found anything that I think is suitable.

Solution 1:

This isn't possible in general because of the confusion between the different meanings of 'dB' and the fact that you can't measure physical Sound Pressure Level (which is generally what people mean when they talk about 'sound meters') without calibrated devices. See my previous answers to similar questions:

Solution 2:

Try using AudioRecord to record the audio to a buffer, then measure the dB's from the 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 = newshort[8000];
record.read(buff, 0, buff.length); 

Post a Comment for "Sound Meter Android"