public class AudioResampler extends Object
| Constructor and Description |
|---|
AudioResampler() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this resampler and free allocated memory.
|
void |
open(AudioFormat srcFormat,
AudioFormat dstFormat,
int frameSamples)
Initializes the
AudioResampler with specified input and output audio formats. |
AudioFrame[] |
resample(AudioFrame frame)
Resample audio samples within the provided audio frame.
|
public void open(AudioFormat srcFormat, AudioFormat dstFormat, int frameSamples) throws JavaAVException
AudioResampler with specified input and output audio formats.
Invocations of resample(AudioFrame) will return audio frames with specified
output audio format. The audio format of provided audio frames must be equal to the
input audio format specified in this method.srcFormat - the input audio format.dstFormat - the output audio format.frameSamples - amount of samples per output frame.JavaAVException - if resampler cannot be opened.public AudioFrame[] resample(AudioFrame frame)
open(AudioFormat, AudioFormat, int). The resampled samples are buffered, if
they do not fit completely in one output frame. Depending on output audio format more
than one frame may be returned.frame - the audio frame with samples to be resampled.public void close()
resample(AudioFrame) will cause errors.Copyright © 2013. All Rights Reserved.