AudioResampler
AudioResampler
#include <icy/av/audioresampler.h>struct AudioResamplerDefined in src/av/include/icy/av/audioresampler.h:39
Converts audio samples between different formats, sample rates, and channel layouts.
List of all members
| Name | Kind | Owner |
|---|---|---|
ctx | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
outSamples | variable | Declared here |
outNumSamples | variable | Declared here |
outBufferSize | variable | Declared here |
maxNumSamples | variable | Declared here |
inSampleFmt | variable | Declared here |
outSampleFmt | variable | Declared here |
AudioResampler | function | Declared here |
~AudioResampler | function | Declared here |
AudioResampler | function | Declared here |
operator= | function | Declared here |
AudioResampler | function | Declared here |
operator= | function | Declared here |
open | function | Declared here |
close | function | Declared here |
resample | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
SwrContext * | ctx | the conversion context |
AudioCodec | iparams | input audio parameters |
AudioCodec | oparams | output audio parameters |
uint8_t ** | outSamples | the output samples buffer |
int | outNumSamples | the number of samples currently in the output buffer |
int | outBufferSize | the number of bytes currently in the buffer |
int | maxNumSamples | the maximum number of samples that can be stored in |
enum AVSampleFormat | inSampleFmt | input sample format |
enum AVSampleFormat | outSampleFmt | output sample format |
ctx
SwrContext * ctxDefined in src/av/include/icy/av/audioresampler.h:69
the conversion context
iparams
AudioCodec iparamsDefined in src/av/include/icy/av/audioresampler.h:71
input audio parameters
oparams
AudioCodec oparamsDefined in src/av/include/icy/av/audioresampler.h:72
output audio parameters
outSamples
uint8_t ** outSamplesDefined in src/av/include/icy/av/audioresampler.h:73
the output samples buffer
outNumSamples
int outNumSamplesDefined in src/av/include/icy/av/audioresampler.h:74
the number of samples currently in the output buffer
outBufferSize
int outBufferSizeDefined in src/av/include/icy/av/audioresampler.h:75
the number of bytes currently in the buffer
maxNumSamples
int maxNumSamplesDefined in src/av/include/icy/av/audioresampler.h:76
the maximum number of samples that can be stored in
inSampleFmt
enum AVSampleFormat inSampleFmtDefined in src/av/include/icy/av/audioresampler.h:77
input sample format
outSampleFmt
enum AVSampleFormat outSampleFmtDefined in src/av/include/icy/av/audioresampler.h:78
output sample format
Public Methods
| Return | Name | Description |
|---|---|---|
AudioResampler | ||
AudioResampler | Deleted constructor. | |
AudioResampler | Deleted constructor. | |
void | open | Initialise the libswresample context using iparams and oparams. Throws std::runtime_error if the context is already open or if required parameters (channels, sample rate, format) are missing. |
void | close | Free the libswresample context and release the output sample buffer. |
int | resample | Convert the input samples to the output format. NOTE: Input buffers must be contiguous, therefore only interleaved input formats are accepted at this point. |
AudioResampler
AudioResampler(const AudioCodec & iparams = AudioCodec(), const AudioCodec & oparams = AudioCodec())Defined in src/av/include/icy/av/audioresampler.h:41
AudioResampler
AudioResampler(const AudioResampler &) = deleteDefined in src/av/include/icy/av/audioresampler.h:45
Deleted constructor.
AudioResampler
AudioResampler(AudioResampler &&) = deleteDefined in src/av/include/icy/av/audioresampler.h:47
Deleted constructor.
open
void open()Defined in src/av/include/icy/av/audioresampler.h:53
Initialise the libswresample context using iparams and oparams. Throws std::runtime_error if the context is already open or if required parameters (channels, sample rate, format) are missing.
close
void close()Defined in src/av/include/icy/av/audioresampler.h:56
Free the libswresample context and release the output sample buffer.
resample
int resample(uint8_t ** inSamples, int inNumSamples)Defined in src/av/include/icy/av/audioresampler.h:67
Convert the input samples to the output format. NOTE: Input buffers must be contiguous, therefore only interleaved input formats are accepted at this point.
Converted samples are accessible via the outSamples class member.
Parameters
inSamplesPointer to the input sample buffer array.inNumSamplesThe number of input samples per channel.
Returns
The number of converted samples, or zero if samples were internally buffered.
