|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.jme.sound.openAL.objects.util.JMEAudioInputStream
com.jme.sound.openAL.objects.util.OggInputStream
Decompresses an Ogg file.
How to use:
1. Create OggInputStream passing in the input stream of the packed ogg file
2. Fetch format and sampling rate using getFormat() and getRate(). Use it to
initalize the sound player.
3. Read the PCM data using one of the read functions, and feed it to your player.
OggInputStream provides a read(ByteBuffer, int, int) that can be used to read data directly into a native buffer.
| Field Summary | |
static int |
FORMAT_MONO16
The mono 16 bit format |
static int |
FORMAT_STEREO16
The stereo 16 bit format |
| Fields inherited from class com.jme.sound.openAL.objects.util.JMEAudioInputStream |
INVALID_OGG_MESSAGE |
| Fields inherited from class java.io.FilterInputStream |
in |
| Constructor Summary | |
OggInputStream(java.io.InputStream input)
Creates an OggInputStream that decompressed the specified ogg file. |
|
| Method Summary | |
int |
available()
Returns 0 after EOF is reached, otherwise always return 1. |
int |
getAudioChannels()
|
int |
getChannels()
|
int |
getFormat()
Gets the format of the ogg file. |
com.jcraft.jorbis.Info |
getInfo()
|
float |
getLength()
|
int |
getRate()
Gets the rate of the pcm audio. |
static void |
main(java.lang.String[] args)
Tests this class by decoding an ogg file to a byte buffer. |
boolean |
markSupported()
OggInputStream does not support mark and reset. |
int |
rate()
|
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream into an array of bytes. |
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 |
reset()
OggInputStream does not support mark and reset. |
protected void |
setLength(float time)
|
long |
skip(long n)
Skips over and discards n bytes of data from the input stream. |
java.lang.String |
toString()
Gets information on the ogg. |
| Methods inherited from class com.jme.sound.openAL.objects.util.JMEAudioInputStream |
getFileName, setFileName |
| Methods inherited from class java.io.FilterInputStream |
close, mark, read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int FORMAT_MONO16
public static final int FORMAT_STEREO16
| Constructor Detail |
public OggInputStream(java.io.InputStream input)
throws java.io.IOException
| Method Detail |
public int getFormat()
public int getRate()
public int read()
throws java.io.IOException
java.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
b - the buffer into which the data is read.off - the start offset of the data.len - the maximum number of bytes read.
java.io.IOException
public int read(java.nio.ByteBuffer b,
int off,
int len)
throws java.io.IOException
read in class JMEAudioInputStreamb - the buffer into which the data is read.off - the start offset of the data.len - the maximum number of bytes read.
java.io.IOException
public int available()
throws java.io.IOException
Programs should not count on this method to return the actual number of bytes that could be read without blocking.
java.io.IOException
public void reset()
throws java.io.IOException
java.io.IOExceptionpublic boolean markSupported()
public long skip(long n)
throws java.io.IOException
n - the number of bytes to be skipped.
java.io.IOExceptionpublic java.lang.String toString()
public static void main(java.lang.String[] args)
public com.jcraft.jorbis.Info getInfo()
public int getChannels()
getChannels in class JMEAudioInputStreampublic int rate()
rate in class JMEAudioInputStreampublic int getAudioChannels()
getAudioChannels in class JMEAudioInputStreamprotected void setLength(float time)
setLength in class JMEAudioInputStreampublic float getLength()
getLength in class JMEAudioInputStream
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||