i am looking for a way to show MIC input level voice strength. i Am using Android AudioRecord to record voice input.
i am following this tutorial for reference
i have implemented this also as
while (isRecording) {
read = recorder.read(data, 0, bufferSize);
if (AudioRecord.ERROR_INVALID_OPERATION != read) {
try {
os.write(data);
int amplitude = (data[0] & 0xff) << 8 | data[1];
amplitude = Math.abs(amplitude);
pbVisulaizer.setProgress(amplitude);
} catch (Exception e) {
e.printStackTrace();
}
}
}
but the amplitude changing is too frequent i am also looking for a maximum progress of progress bar according to recording quality. any suggestions.