You can do noise removal in the preprocessing phase. Here I filtered the audible range for speech and music. I found this to be very effective during my tests, not NoiseSuppressor. Ways of use and utilities,
recorder.read(data, 0, data.length); if(isAudible(data)) { // TODO further processing can go here } public static boolean isAudible(short[] data) { double rms = getRootMeanSquared(data); return (rms > 198 && 5600 > rms); } public static double getRootMeanSquared(short[] data) { double ms = 0; for (int i = 0; i < data.length; i++) { ms += data[i] * data[i]; } ms /= data.length; return Math.sqrt(ms); }
source share