public class CodecJLayerMP3 extends Object implements ICodec
| Constructor and Description |
|---|
CodecJLayerMP3() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Should close any open streams and remove references to all instantiated
objects.
|
boolean |
endOfStream()
Should return false if there is still more data available to be read in.
|
AudioFormat |
getAudioFormat()
Should return the audio format of the data being returned by the read() and
readAll() methods.
|
boolean |
initialize(URL url)
Should make any preperations required before reading from the audio stream.
|
boolean |
initialized()
Should return false if the stream is busy initializing.
|
SoundBuffer |
read()
Should read in one stream buffer worth of audio data.
|
SoundBuffer |
readAll()
Should read in all the audio data from the stream (up to the default
"maximum file size".
|
void |
reverseByteOrder(boolean b)
Should tell derived classes when they may need to reverse the byte order of
the data before returning it in the read() and readAll() methods.
|
static void |
reverseBytes(byte[] buffer)
Reverse-orders all bytes contained in the specified array.
|
static void |
reverseBytes(byte[] buffer,
int offset,
int size)
Reverse-orders the specified range of bytes contained in the specified
array.
|
public void reverseByteOrder(boolean b)
ICodecreverseByteOrder in interface ICodecb - True if the calling audio library requires byte-reversal by some codec libraries.public boolean initialize(URL url)
ICodecinitialize in interface ICodecpublic boolean initialized()
ICodecinitialized in interface ICodecpublic SoundBuffer read()
ICodecSoundSystemConfig for more
information about accessing and changing default settings.public SoundBuffer readAll()
ICodecSoundSystemConfig for more
information about accessing and changing default settings.public boolean endOfStream()
ICodecendOfStream in interface ICodecpublic void cleanup()
ICodecpublic AudioFormat getAudioFormat()
ICodecgetAudioFormat in interface ICodecpublic static void reverseBytes(byte[] buffer)
buffer - Array containing audio data.public static void reverseBytes(byte[] buffer,
int offset,
int size)
buffer - Array containing audio data.offset - Array index to begin.size - number of bytes to reverse-order.Copyright © 2017. All rights reserved.