/*
 * This program reads in a wav file and applies a SyncKernel lowpass filter;
 * the output is the new wav file.
 * Usage: main in.wav out.wav
 */

import java.lang.*;
import java.io.*;
import javax.sound.sampled.*;

class stats {

    public static void main(String[] args) {
		int numFiles = args.length;
		for(int i=0; i<numFiles; i++) {
			String filename = args[i];
			System.out.println("file: \"" + filename + "\"");
			// check that it has .wav extension
			if (! (filename.toLowerCase().endsWith(".wav"))) {
				System.err.println("file \"" + filename +
					"\" is not a .wav file!\n");
				continue;
			}


			WavReader wr = new WavReader(new File(filename));

			int samplerate = wr.getSampleRate();
			System.err.println("Sample rate: " + samplerate + ", sample size: " +
					wr.getSampleSize());

			double cutoffFrequency = 365; // in Hertz


			int theSize = wr.getNumSamples();

			short[] theSound = wr.getShortSamples(); // new int[theSize];

			// adjust volume as necessary; it should *not* be necessary

			System.out.println("stats for input:");
			WavReader.printstats2(theSound);
			System.out.println();
		}
	}


}
