Package edu.purdue.wind.util

Source Code of edu.purdue.wind.util.PlotWave

package edu.purdue.wind.util;

import java.io.IOException;

import edu.purdue.wind.Wave;

public class PlotWave {
    public static void main(String[] args) {
  if (args.length != 1) {
      System.err.println("usage: PlotWave <file.wav>");
      System.exit(1);
  }

  Wave wave;
  try {
      wave = Wave.readFile(args[0]);
  } catch (IOException e) {
      throw new RuntimeException(e);
  }

  final int[] samples = wave.sampleData((short)0);
  final int nSamples = wave.samples();

  for (int i = 0; i < nSamples; i++) {
      System.out.println("" + i + " " + samples[i]);
  }
    }
}
TOP

Related Classes of edu.purdue.wind.util.PlotWave

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.