package edu.purdue.wind.util;
import java.io.IOException;
import edu.purdue.wind.Wave;
public class WaveParser {
public static void main(String[] args) {
if (args.length != 1) {
System.err.println("usage: WaveParser <file.wav>");
System.exit(1);
}
Wave wave;
try {
wave = Wave.readFile(args[0]);
} catch (IOException e) {
throw new RuntimeException(e);
}
System.out.println("Bits per sample: " + wave.sampleBits());
System.out.println("Sample rate (Hz): " + wave.sampleRate());
System.out.println("Channels: " + wave.channels());
System.out.println("Number of samples: " + wave.samples());
}
}