toxi.audio
Class DecompressInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by toxi.audio.DecompressInputStream
All Implemented Interfaces:
java.io.Closeable

public class DecompressInputStream
extends java.io.FilterInputStream

Convert A-Law or u-Law byte stream into mono PCM byte stream

static AudioFormat alawformat= new AudioFormat(AudioFormat.Encoding.ALAW,8000,8,1,1,8000,false); static AudioFormat ulawformat= new AudioFormat(AudioFormat.Encoding.ULAW,8000,8,1,1,8000,false);

PCM 8000.0 Hz, 16 bit, mono, SIGNED, little-endian

static AudioFormat pcmformat = new AudioFormat(8000,16,1,true,false);

From: Mathematical Tools in Signal Processing with C++ and Java Simulations by Willi-Hans Steeb International School for Scientific Computing


Constructor Summary
DecompressInputStream(java.io.InputStream in, boolean useALaw)
           
 
Method Summary
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecompressInputStream

public DecompressInputStream(java.io.InputStream in,
                             boolean useALaw)
                      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException