|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tritonus.lowlevel.lame.Lame
public class Lame
Low level wrapper for the LAME native encoder.
Field Summary | |
---|---|
static int |
BITRATE_AUTO
|
static int |
CHANNEL_MODE_AUTO
|
static int |
CHANNEL_MODE_DUAL_CHANNEL
|
static int |
CHANNEL_MODE_JOINT_STEREO
|
static int |
CHANNEL_MODE_MONO
|
static int |
CHANNEL_MODE_STEREO
|
static int |
MPEG_VERSION_1
|
static int |
MPEG_VERSION_2
|
static int |
MPEG_VERSION_2DOT5
|
static AudioFormat.Encoding |
MPEG1L3
|
static AudioFormat.Encoding |
MPEG2DOT5L3
|
static AudioFormat.Encoding |
MPEG2L3
|
static java.lang.String |
P_BITRATE
property key to read/set the bitrate: an Integer value. |
static java.lang.String |
P_CHMODE
property key to read/set the channel mode: a String, one of "jointstereo", "dual", "mono", "auto" (default). |
static java.lang.String |
P_ENCODING
legacy: system property key to read the effective encoding of the encoded audio data, an instance of AudioFormat.Encoding |
static java.lang.String |
P_QUALITY
property key to read/set the quality: an Integer from 1 (highest) to 9 (lowest). |
static java.lang.String |
P_SAMPLERATE
legacy: system property key to read the effective sample rate of the encoded audio stream (an instance of Float) |
static java.lang.String |
P_VBR
property key to read/set the VBR mode: an instance of Boolean (default: false) |
static int |
QUALITY_HIGH
|
static int |
QUALITY_HIGHEST
|
static int |
QUALITY_LOW
|
static int |
QUALITY_LOWEST
|
static int |
QUALITY_MIDDLE
|
Constructor Summary | |
---|---|
Lame(AudioFormat sourceFormat)
Initializes the encoder with the given source/PCM format. |
|
Lame(AudioFormat sourceFormat,
AudioFormat targetFormat)
Initializes the encoder with the given source/PCM format. |
|
Lame(AudioFormat sourceFormat,
int bitRate,
int channelMode,
int quality,
boolean VBR)
Initializes the encoder, overriding any parameters set in the audio format's properties or in the system properties. |
Method Summary | |
---|---|
void |
close()
|
int |
encodeBuffer(byte[] pcm,
int offset,
int length,
byte[] encoded)
Encode a block of data. |
int |
encodeFinish(byte[] encoded)
|
int |
getEffectiveBitRate()
|
int |
getEffectiveChannelMode()
|
AudioFormat.Encoding |
getEffectiveEncoding()
|
AudioFormat |
getEffectiveFormat()
Return the audioformat representing the encoded mp3 stream. |
int |
getEffectiveQuality()
|
int |
getEffectiveSampleRate()
|
boolean |
getEffectiveVBR()
|
java.lang.String |
getEncoderVersion()
|
static java.lang.String |
getLinkError()
|
int |
getMP3BufferSize()
|
int |
getPCMBufferSize()
Returns the buffer needed pcm buffer size. |
static boolean |
isLibAvailable()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final AudioFormat.Encoding MPEG1L3
public static final AudioFormat.Encoding MPEG2L3
public static final AudioFormat.Encoding MPEG2DOT5L3
public static final java.lang.String P_ENCODING
public static final java.lang.String P_SAMPLERATE
public static final java.lang.String P_VBR
public static final java.lang.String P_CHMODE
public static final java.lang.String P_BITRATE
public static final java.lang.String P_QUALITY
public static final int MPEG_VERSION_2
public static final int MPEG_VERSION_1
public static final int MPEG_VERSION_2DOT5
public static final int QUALITY_LOWEST
public static final int QUALITY_LOW
public static final int QUALITY_MIDDLE
public static final int QUALITY_HIGH
public static final int QUALITY_HIGHEST
public static final int CHANNEL_MODE_STEREO
public static final int CHANNEL_MODE_JOINT_STEREO
public static final int CHANNEL_MODE_DUAL_CHANNEL
public static final int CHANNEL_MODE_MONO
public static final int CHANNEL_MODE_AUTO
public static final int BITRATE_AUTO
Constructor Detail |
---|
public Lame(AudioFormat sourceFormat)
java.lang.IllegalArgumentException
- when parameters are not supported by
LAME.public Lame(AudioFormat sourceFormat, AudioFormat targetFormat)
java.lang.IllegalArgumentException
- when parameters are not supported by
LAME.public Lame(AudioFormat sourceFormat, int bitRate, int channelMode, int quality, boolean VBR)
java.lang.IllegalArgumentException
- when parameters are not supported by
LAME.Method Detail |
---|
public java.lang.String getEncoderVersion()
public int getPCMBufferSize()
public int getMP3BufferSize()
public int encodeBuffer(byte[] pcm, int offset, int length, byte[] encoded) throws java.lang.ArrayIndexOutOfBoundsException
encoded
array is too small, an
ArrayIndexOutOfBoundsException is thrown. length
should be
the value returned by getPCMBufferSize.
encoded
. May be 0.
java.lang.ArrayIndexOutOfBoundsException
public int encodeFinish(byte[] encoded)
public void close()
public static boolean isLibAvailable()
public static java.lang.String getLinkError()
public AudioFormat getEffectiveFormat()
public int getEffectiveQuality()
public int getEffectiveBitRate()
public int getEffectiveChannelMode()
public boolean getEffectiveVBR()
public int getEffectiveSampleRate()
public AudioFormat.Encoding getEffectiveEncoding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |