org.tritonus.lowlevel.lame
Class Lame
java.lang.Object
org.tritonus.lowlevel.lame.Lame
- public class Lame
- extends Object
Constructor Summary |
Lame(AudioFormat sourceFormat)
Initializes the decoder with
DEFAULT_BITRATE, DEFAULT_CHANNEL_MODE, DEFAULT_QUALITY, and DEFAULT_VBR
Throws IllegalArgumentException when parameters are not supported
by LAME. |
Lame(AudioFormat sourceFormat,
int bitRate,
int channelMode,
int quality,
boolean VBR)
Initializes the decoder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QUALITY_LOWEST
public static final int QUALITY_LOWEST
- See Also:
- Constant Field Values
QUALITY_LOW
public static final int QUALITY_LOW
- See Also:
- Constant Field Values
QUALITY_MIDDLE
public static final int QUALITY_MIDDLE
- See Also:
- Constant Field Values
QUALITY_HIGH
public static final int QUALITY_HIGH
- See Also:
- Constant Field Values
QUALITY_HIGHEST
public static final int QUALITY_HIGHEST
- See Also:
- Constant Field Values
CHANNEL_MODE_STEREO
public static final int CHANNEL_MODE_STEREO
- See Also:
- Constant Field Values
CHANNEL_MODE_JOINT_STEREO
public static final int CHANNEL_MODE_JOINT_STEREO
- See Also:
- Constant Field Values
CHANNEL_MODE_DUAL_CHANNEL
public static final int CHANNEL_MODE_DUAL_CHANNEL
- See Also:
- Constant Field Values
CHANNEL_MODE_MONO
public static final int CHANNEL_MODE_MONO
- See Also:
- Constant Field Values
CHANNEL_MODE_AUTO
public static final int CHANNEL_MODE_AUTO
- See Also:
- Constant Field Values
BITRATE_AUTO
public static final int BITRATE_AUTO
- See Also:
- Constant Field Values
Lame
public Lame(AudioFormat sourceFormat)
- Initializes the decoder with
DEFAULT_BITRATE, DEFAULT_CHANNEL_MODE, DEFAULT_QUALITY, and DEFAULT_VBR
Throws IllegalArgumentException when parameters are not supported
by LAME.
Lame
public Lame(AudioFormat sourceFormat,
int bitRate,
int channelMode,
int quality,
boolean VBR)
- Initializes the decoder.
Throws IllegalArgumentException when parameters are not supported
by LAME.
getEncoderVersion
public String getEncoderVersion()
getPCMBufferSize
public int getPCMBufferSize()
- Returns the buffer needed pcm buffer size.
The passed parameter is a wished buffer size.
The implementation of the encoder may return
a lower or higher buffer size.
The encoder must be initalized (i.e. not closed) at this point.
A return value of <0 denotes an error.
getMP3BufferSize
public int getMP3BufferSize()
encodeBuffer
public int encodeBuffer(byte[] pcm,
int offset,
int length,
byte[] encoded)
throws ArrayIndexOutOfBoundsException
- Encode a block of data. Throws IllegalArgumentException when parameters
are wrong.
When the
encoded
array is too small,
an ArrayIndexOutOfBoundsException is thrown.
length
should be the value returned by getPCMBufferSize.
- Returns:
- the number of bytes written to
encoded
. May be 0.
- Throws:
ArrayIndexOutOfBoundsException
encodeFinish
public int encodeFinish(byte[] encoded)
close
public void close()
isLibAvailable
public static boolean isLibAvailable()
getLinkError
public static String getLinkError()
getEffectiveQuality
public int getEffectiveQuality()
getEffectiveBitRate
public int getEffectiveBitRate()
getEffectiveChannelMode
public int getEffectiveChannelMode()
getEffectiveVBR
public boolean getEffectiveVBR()
getEffectiveSampleRate
public int getEffectiveSampleRate()
getEffectiveEncoding
public AudioFormat.Encoding getEffectiveEncoding()