utilities
Class WavRoutines

java.lang.Object
  |
  +--utilities.WavRoutines

public class WavRoutines
extends java.lang.Object

Misc Routines to facilitate sound file manipulation


Constructor Summary
WavRoutines()
           
 
Method Summary
static void fileDoubles(double[] doubleStream, javax.sound.sampled.AudioFormat auf)
           
static javax.sound.sampled.AudioInputStream getAudioInputStream(java.lang.String strFilename)
           
static void getByteData(double[] dat, byte[] byteArray, javax.sound.sampled.AudioFormat audioFormat)
          given an array of doubles(in this case, the inverse transform) returns the signal representation in bytes.
static double[] getDoubleData(byte[] inBytes, javax.sound.sampled.AudioFormat audioFormat)
           
static double[] getDoubleData(byte[] inBytes, int numBytes, javax.sound.sampled.AudioFormat audioFormat)
           
static void getDoubleData(byte[] inBytes, int inStart, int inEnd, double[] dData, javax.sound.sampled.AudioFormat audioFormat)
           
static double[] getPowerOfTwoDoubleData(javax.sound.sampled.AudioInputStream audioIn, javax.sound.sampled.AudioFormat audioFormat)
          Gives power-of-two length portion of input signal given in AudioInputStram audioIn.
static int maxLengthInSamples(javax.sound.sampled.AudioInputStream audioInputStream, javax.sound.sampled.AudioFormat format)
           
static void normalize(double[] inputSample)
           
static void playDoubles(double[] doubleStream, javax.sound.sampled.AudioFormat auf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WavRoutines

public WavRoutines()
Method Detail

getPowerOfTwoDoubleData

public static double[] getPowerOfTwoDoubleData(javax.sound.sampled.AudioInputStream audioIn,
                                               javax.sound.sampled.AudioFormat audioFormat)
Gives power-of-two length portion of input signal given in AudioInputStram audioIn. returns the power of two (depth) of the signal.

getDoubleData

public static void getDoubleData(byte[] inBytes,
                                 int inStart,
                                 int inEnd,
                                 double[] dData,
                                 javax.sound.sampled.AudioFormat audioFormat)

getDoubleData

public static double[] getDoubleData(byte[] inBytes,
                                     javax.sound.sampled.AudioFormat audioFormat)

getDoubleData

public static double[] getDoubleData(byte[] inBytes,
                                     int numBytes,
                                     javax.sound.sampled.AudioFormat audioFormat)

getByteData

public static void getByteData(double[] dat,
                               byte[] byteArray,
                               javax.sound.sampled.AudioFormat audioFormat)
given an array of doubles(in this case, the inverse transform) returns the signal representation in bytes.

maxLengthInSamples

public static int maxLengthInSamples(javax.sound.sampled.AudioInputStream audioInputStream,
                                     javax.sound.sampled.AudioFormat format)

getAudioInputStream

public static javax.sound.sampled.AudioInputStream getAudioInputStream(java.lang.String strFilename)

normalize

public static void normalize(double[] inputSample)

fileDoubles

public static void fileDoubles(double[] doubleStream,
                               javax.sound.sampled.AudioFormat auf)

playDoubles

public static void playDoubles(double[] doubleStream,
                               javax.sound.sampled.AudioFormat auf)