Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}