Java tutorial
//package com.java2s; public class Main { public static short audioRange(short[] track) { //Returns largest amplitude ("volume") of an audio track short range = 0; for (int i = 0; i < track.length; i++) { if (Math.abs(track[i]) > range) range = (short) Math.abs(track[i]); } return range; } }