public interface AudioEncoder
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Release encoder resources.
|
byte[] |
encode(short[] samples,
int numSamples)
Encode PCM samples to compressed audio bytes.
|
int |
getFrameSize()
Get the frame size in PCM samples of this audio codec.
|
com.google.common.net.MediaType |
getMediaType()
The MediaType of the compressed audio.
|
int |
getPacketSize()
Get the packet size of this audio codec for optimizing transmission.
|
AudioEncoder |
newEncoder()
Make a new encoder with the same configuration.
|
byte[] encode(short[] samples, int numSamples) throws AudioEncoderException
samples
- the samples to compress.numSamples
- the number of samples int the buffer to compress.AudioEncoderException
- when there's an error encoding the audio.com.google.common.net.MediaType getMediaType()
int getFrameSize()
int getPacketSize()
void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
AudioEncoder newEncoder()