|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GenericEncoder
This interface may be used to progressively encode PCM data to MP3.
LAME flags must be set up before starting an encoding task, LAME
uses the default configuration and no configuration data (number of channels etc)
is extracted from the audio data provided to the encoder, in fact
only raw PCM is supposed. Call the Encoder.getEncoderConfig()
method
to config the encoder.
A complete encoding process does not close the encoder and can be reused.
The encoder must be closed explicitly (see Encoder.close()
).
The encoding process does not add the VBR Info tag, you can use the
method Encoder.writeVbrTag(String)
Note: if you want to encode a WAV file using this interface, skip the WAV header first (skips the first 44 bytes of the file)
LAMEOnJStdEncoder.createGenericEncoder()
Method Summary | |
---|---|
int |
encodeBuffer(byte[] pcmBuffer,
int size,
byte[] mp3Buffer)
Encodes a chunk of raw PCM data, if stereo source audio data must be interleaved. |
int |
encodeFlush(byte[] mp3Buffer)
Finalizes the encoding task, any remainder MP3 data in the encoder is flushed to the MP3 buffer. |
void |
initEncoding(int[] pcmBufferSize,
int[] mp3BufferSize)
Starts an encoding process. |
Methods inherited from interface lameonj.encoder.std.Encoder |
---|
close, getEncoderConfig, getLameFlags, isClosed, writeVbrTag |
Method Detail |
---|
void initEncoding(int[] pcmBufferSize, int[] mp3BufferSize)
The required size of source PCM and target MP3 byte buffers are returned using the first array item of the provided parameters.
pcmBufferSize
- the one element array where the required PCM buffer size is saved.mp3BufferSize
- the one element array where the required MP3 buffer size is saved.int encodeBuffer(byte[] pcmBuffer, int size, byte[] mp3Buffer)
PCM and MP3 buffers must have the lengths provided by the method
initEncoding(int[],int[])
pcmBuffer
- the PCM data to encode.size
- the number of bytes with PCM data.mp3Buffer
- the MP3 buffer to fill with the encoded MP3 audio.
int encodeFlush(byte[] mp3Buffer)
mp3Buffer
- the MP3 buffer to fill with the encoded MP3 audio.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |