ch.aplu.util
Class SoundReader

java.lang.Object
  extended by ch.aplu.util.SoundReader

public class SoundReader
extends java.lang.Object

Class for reading sound files and extract sound data. Sound format supported: WAV, ALAW, ULAW


Constructor Summary
SoundReader(java.io.File audioFile)
          Construct a sound reader attached to given sound file.
SoundReader(java.lang.String audioPathname)
          Construct a sound reader attached to given sound file path.
 
Method Summary
 void getSamples(double[] samples)
           
 void getStereoSamples(double[] leftSamples, double[] rightSamples)
           
 long getTotalNbSamples()
          Return the number of samples of all channels
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundReader

public SoundReader(java.io.File audioFile)
Construct a sound reader attached to given sound file.


SoundReader

public SoundReader(java.lang.String audioPathname)
Construct a sound reader attached to given sound file path.

Method Detail

getTotalNbSamples

public long getTotalNbSamples()
Return the number of samples of all channels


getSamples

public void getSamples(double[] samples)
                throws java.io.IOException,
                       java.lang.IllegalArgumentException
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getStereoSamples

public void getStereoSamples(double[] leftSamples,
                             double[] rightSamples)
                      throws java.io.IOException
Throws:
java.io.IOException