android: Detect sound level
Use mRecorder.getMaxAmplitude(); For the analysis of sound without saving all you need is use mRecorder.setOutputFile(“/dev/null”); HereĀ“s an example, I hope this helps public class SoundMeter { private MediaRecorder mRecorder = null; public void start() { if (mRecorder == null) { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(“/dev/null”); mRecorder.prepare(); mRecorder.start(); } } public void stop() … Read more