com.jmex.audio.stream
Class AudioInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.jmex.audio.stream.AudioInputStream
- All Implemented Interfaces:
- java.io.Closeable
- Direct Known Subclasses:
- OggInputStream, WavInputStream
public abstract class AudioInputStream
- extends java.io.FilterInputStream
Super class for audio streams implementing the ability to interpret a
specific audio format.
- Version:
- $Id: AudioInputStream.java 4133 2009-03-19 20:40:11Z blaine.dev $
- Author:
- Arman Ozcelik, Joshua Slack
Fields inherited from class java.io.FilterInputStream |
in |
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 |
filters
protected java.util.ArrayList<Filter> filters
AudioInputStream
public AudioInputStream(java.net.URL resource,
float length)
throws java.io.IOException
- Throws:
java.io.IOException
read
public abstract int read(java.nio.ByteBuffer buffer,
int offset,
int length)
throws java.io.IOException
- Reads up to len bytes of data from the input stream into a ByteBuffer.
- 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
addFilter
public void addFilter(Filter f)
- Adds a DSP filter on this stream
- Parameters:
f
- the filter to apply on the stream
getChannelCount
public abstract int getChannelCount()
- Returns:
- number of channels in this stream
getBitRate
public abstract int getBitRate()
- Returns:
- the bitrate of this stream
getDepth
public abstract int getDepth()
- Returns:
- the bit depth of this stream
getResource
public java.net.URL getResource()
makeNew
public abstract AudioInputStream makeNew()
throws java.io.IOException
- Throws:
java.io.IOException
getLength
public float getLength()
setLength
public void setLength(float length)
sniffFormat
public static AudioTrack.Format sniffFormat(java.io.InputStream stream)
throws java.io.IOException
- Throws:
java.io.IOException