I am using audioRecord instead of mediarecorder in my app it\'s working fine but I have a logic that depends highly on the maxamplitude which is really hard to obtain using the
int amplitude = (buffer[0] & 0xff) << 8 | buffer[1]; amplitude = Math.abs(ab);
Do you make a mistake here? I think it should be
int ab = (buffer[0] & 0xff) << 8 | buffer[1]; int amplitude = Math.abs(ab);