com.jmex.audio.stream
Class WavInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.jmex.audio.stream.AudioInputStream
              extended by com.jmex.audio.stream.WavInputStream
All Implemented Interfaces:
java.io.Closeable

public class WavInputStream
extends AudioInputStream


Field Summary
 
Fields inherited from class com.jmex.audio.stream.AudioInputStream
filters
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
WavInputStream(java.net.URL resource)
           
 
Method Summary
 int getBitRate()
           
 int getChannelCount()
           
 int getDepth()
           
 WavInputStream makeNew()
           
 boolean marksupported()
           
 int read(java.nio.ByteBuffer b, int off, int len)
          Reads up to len bytes of data from the input stream into a ByteBuffer.
 void readSample(byte[] b, int start, int length)
           
 void readSample(int[] b, int start, int length)
           
 void readSample(short[] b, int start, int length)
           
 
Methods inherited from class com.jmex.audio.stream.AudioInputStream
addFilter, getLength, getResource, setLength, sniffFormat
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WavInputStream

public WavInputStream(java.net.URL resource)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

read

public int read(java.nio.ByteBuffer b,
                int off,
                int len)
         throws java.io.IOException
Reads up to len bytes of data from the input stream into a ByteBuffer.

Specified by:
read in class AudioInputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Throws:
java.io.IOException

getChannelCount

public int getChannelCount()
Specified by:
getChannelCount in class AudioInputStream
Returns:
number of channels in this stream

getDepth

public int getDepth()
Specified by:
getDepth in class AudioInputStream
Returns:
the bit depth of this stream

getBitRate

public int getBitRate()
Specified by:
getBitRate in class AudioInputStream
Returns:
the bitrate of this stream

marksupported

public boolean marksupported()

readSample

public void readSample(byte[] b,
                       int start,
                       int length)
                throws java.io.IOException
Throws:
java.io.IOException

readSample

public void readSample(short[] b,
                       int start,
                       int length)
                throws java.io.IOException
Throws:
java.io.IOException

readSample

public void readSample(int[] b,
                       int start,
                       int length)
                throws java.io.IOException
Throws:
java.io.IOException

makeNew

public WavInputStream makeNew()
                       throws java.io.IOException
Specified by:
makeNew in class AudioInputStream
Throws:
java.io.IOException