Package com.ardor3d.audio.codecs
Class CodecJOrbis
java.lang.Object
com.ardor3d.audio.codecs.CodecJOrbis
- All Implemented Interfaces:
ICodec
The CodecJOrbis class provides an ICodec interface to the external JOrbis
library.
SoundSystem CodecJOrbis Class License:
You are free to use this class for any purpose, commercial or otherwise. You may modify this class or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any unmodified portion of it.
2) You may not copyright this class or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this class in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this class or any portion of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this class or any portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the JOrbis library available from http://www.jcraft.com/jorbis/
Author: Paul Lamb
http://www.paulscode.com
You are free to use this class for any purpose, commercial or otherwise. You may modify this class or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this class or any unmodified portion of it.
2) You may not copyright this class or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this class in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this class or any portion of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this class or any portion of it.
Author: Paul Lamb
http://www.paulscode.com
This software is based on or using the JOrbis library available from http://www.jcraft.com/jorbis/
Author: Paul Lamb
http://www.paulscode.com
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Closes the input stream and remove references to all instantiated objects.boolean
Returns false if there is still more data available to be read in.Returns the audio format of the data being returned by the read() and readAll() methods.boolean
initialize
(URL url) Prepares an input stream to read from.boolean
Returns false if the stream is busy initializing.read()
Reads in one stream buffer worth of audio data.readAll()
Reads in all the audio data from the stream (up to the default "maximum file size".void
reverseByteOrder
(boolean b) This method is ignored by CodecJOrbis, because it produces "nice" data.
-
Constructor Details
-
CodecJOrbis
public CodecJOrbis()Constructor: Grabs a handle to the logger.
-
-
Method Details
-
reverseByteOrder
public void reverseByteOrder(boolean b) This method is ignored by CodecJOrbis, because it produces "nice" data.- Specified by:
reverseByteOrder
in interfaceICodec
- Parameters:
b
- True if the calling audio library requires byte-reversal from certain codecs
-
initialize
Prepares an input stream to read from. If another stream is already opened, it will be closed and a new input stream opened in its place.- Specified by:
initialize
in interfaceICodec
- Parameters:
url
- URL to an ogg file to stream from.- Returns:
- False if an error occurred or if end of stream was reached.
-
initialized
public boolean initialized()Returns false if the stream is busy initializing.- Specified by:
initialized
in interfaceICodec
- Returns:
- True if steam is initialized.
-
read
Reads in one stream buffer worth of audio data. SeeSoundSystemConfig
for more information about accessing and changing default settings. -
readAll
Reads in all the audio data from the stream (up to the default "maximum file size". SeeSoundSystemConfig
for more information about accessing and changing default settings. -
endOfStream
public boolean endOfStream()Returns false if there is still more data available to be read in.- Specified by:
endOfStream
in interfaceICodec
- Returns:
- True if end of stream was reached.
-
cleanup
public void cleanup()Closes the input stream and remove references to all instantiated objects. -
getAudioFormat
Returns the audio format of the data being returned by the read() and readAll() methods.- Specified by:
getAudioFormat
in interfaceICodec
- Returns:
- Information wrapped into an AudioFormat context.
-