Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
PCM format mapper. Convert between PCM formats. More...
#include <pcm_mapper.h>
Public Member Functions | |
PcmMapper (PcmFormat input_fmt, PcmFormat output_fmt) | |
Initialize. More... | |
PcmFormat | input_format () const |
Get input format. More... | |
PcmFormat | output_format () const |
Get output format. More... | |
size_t | input_sample_count (size_t input_bytes) const |
Get number of input samples per channel for given number of bytes. More... | |
size_t | output_sample_count (size_t output_bytes) const |
Get number of input samples per channel for given number of bytes. More... | |
size_t | input_byte_count (size_t input_samples) const |
Get number of input bytes for given number of samples per channel. More... | |
size_t | output_byte_count (size_t output_samples) const |
Get number of output bytes for given number of samples per channel. More... | |
size_t | input_bit_count (size_t input_samples) const |
Get number of input bits for given number of samples per channel. More... | |
size_t | output_bit_count (size_t output_samples) const |
Get number of output bits for given number of samples per channel. More... | |
size_t | map (const void *in_data, size_t in_byte_size, size_t &in_bit_off, void *out_data, size_t out_byte_size, size_t &out_bit_off, size_t n_samples) |
Map samples from input to output format. More... | |
PCM format mapper. Convert between PCM formats.
Definition at line 24 of file pcm_mapper.h.
Initialize.
input_fmt
and output_fmt
should be PCM formats. size_t roc::audio::PcmMapper::input_bit_count | ( | size_t | input_samples | ) | const |
Get number of input bits for given number of samples per channel.
size_t roc::audio::PcmMapper::input_byte_count | ( | size_t | input_samples | ) | const |
Get number of input bytes for given number of samples per channel.
PcmFormat roc::audio::PcmMapper::input_format | ( | ) | const |
Get input format.
size_t roc::audio::PcmMapper::input_sample_count | ( | size_t | input_bytes | ) | const |
Get number of input samples per channel for given number of bytes.
size_t roc::audio::PcmMapper::map | ( | const void * | in_data, |
size_t | in_byte_size, | ||
size_t & | in_bit_off, | ||
void * | out_data, | ||
size_t | out_byte_size, | ||
size_t & | out_bit_off, | ||
size_t | n_samples | ||
) |
Map samples from input to output format.
in_data
is a pointer to input buffer in_byte_size
is size of input buffer in bytes in_bit_off
is an offset in input buffer in bits out_data
is a pointer to output buffer out_byte_size
is size of output buffer in bytes out_bit_off
is an offset in output buffer in bits n_samples
is number of input and output samples for all channels in_bit_off
and out_bit_off
size_t roc::audio::PcmMapper::output_bit_count | ( | size_t | output_samples | ) | const |
Get number of output bits for given number of samples per channel.
size_t roc::audio::PcmMapper::output_byte_count | ( | size_t | output_samples | ) | const |
Get number of output bytes for given number of samples per channel.
PcmFormat roc::audio::PcmMapper::output_format | ( | ) | const |
Get output format.
size_t roc::audio::PcmMapper::output_sample_count | ( | size_t | output_bytes | ) | const |
Get number of input samples per channel for given number of bytes.