RAVENNAKIT
Loading...
Searching...
No Matches
rav::AudioData Class Reference

#include <audio_data.hpp>

Classes

struct  Interleaving
 Types for specifying interleaving. More...
struct  ByteOrder
 Types for specifying byte order. More...

Static Public Member Functions

template<class SrcType, class SrcByteOrder, class DstType, class DstByteOrder>
static void convert_sample (const SrcType *src, DstType *dst)
 Converts a sample from one format to another.
template<class SrcType, class SrcByteOrder, class SrcInterleaving, class DstType, class DstByteOrder, class DstInterleaving>
static void convert (const SrcType *src, const size_t src_size, DstType *dst, const size_t dst_size, const size_t num_channels)
 Converts audio data from one format to another and converts interleaving and byte order.
template<class SrcType, class SrcByteOrder, class SrcInterleaving, class DstType, class DstByteOrder>
static void convert (const SrcType *src, const size_t num_frames, const size_t num_channels, DstType *const *dst, const size_t src_start_frame=0, const size_t dst_start_frame=0)
 Converts audio data from one format to another and converts interleaving and byte order.
template<class SrcType, class SrcByteOrder, class DstType, class DstByteOrder, class DstInterleaving>
static void convert (const SrcType *const *src, const size_t num_frames, const size_t num_channels, DstType *dst, const size_t src_start_frame, const size_t dst_start_frame=0)
 Converts audio data from one format to another and converts interleaving and byte order.
static void de_interleave (const BufferView< uint8_t > input_buffer, const BufferView< uint8_t > output_buffer, const size_t num_channels, const size_t bytes_per_sample)
 Converts interleaved audio data to non-interleaved audio data.
static void interleave (const BufferView< uint8_t > input_buffer, const BufferView< uint8_t > output_buffer, const size_t num_channels, const size_t bytes_per_sample, const size_t num_frames)
 Converts non-interleaved audio data to interleaved audio data.

Detailed Description

Definition at line 39 of file audio_data.hpp.

Member Function Documentation

◆ convert() [1/3]

template<class SrcType, class SrcByteOrder, class DstType, class DstByteOrder, class DstInterleaving>
void rav::AudioData::convert ( const SrcType *const * src,
const size_t num_frames,
const size_t num_channels,
DstType * dst,
const size_t src_start_frame,
const size_t dst_start_frame = 0 )
inlinestatic

Converts audio data from one format to another and converts interleaving and byte order.

Template Parameters
SrcTypeThe source sample format.
SrcByteOrderThe source byte order. One of the structs in the byte_order namespace.
DstTypeThe destination sample format.
DstByteOrderThe destination byte order. One of the structs in the byte_order namespace.
DstInterleavingThe destination interleaving. One of the structs in the interleaving namespace.
Parameters
srcThe source data.
num_framesThe number of frames in the audio data.
num_channelsThe number of channels in the audio data.
dstThe destination data.
src_start_frameThe starting frame in the source data.
dst_start_frameThe starting frame in the destination data.
Returns
True if the conversion was successful, false otherwise.

Definition at line 400 of file audio_data.hpp.

◆ convert() [2/3]

template<class SrcType, class SrcByteOrder, class SrcInterleaving, class DstType, class DstByteOrder>
void rav::AudioData::convert ( const SrcType * src,
const size_t num_frames,
const size_t num_channels,
DstType *const * dst,
const size_t src_start_frame = 0,
const size_t dst_start_frame = 0 )
inlinestatic

Converts audio data from one format to another and converts interleaving and byte order.

Template Parameters
SrcTypeThe source sample format.
SrcByteOrderThe source byte order. One of the structs in the byte_order namespace.
SrcInterleavingThe source interleaving. One of the structs in the interleaving namespace.
DstTypeThe destination sample format.
DstByteOrderThe destination byte order. One of the structs in the byte_order namespace.
Parameters
srcThe source data.
num_framesThe size of the source data.
num_channelsThe number of channels in the audio data.
dstThe destination data.
src_start_frameThe starting frame in the source data.
dst_start_frameThe starting frame in the destination data.
Returns
True if the conversion was successful, false otherwise.

Definition at line 354 of file audio_data.hpp.

◆ convert() [3/3]

template<class SrcType, class SrcByteOrder, class SrcInterleaving, class DstType, class DstByteOrder, class DstInterleaving>
void rav::AudioData::convert ( const SrcType * src,
const size_t src_size,
DstType * dst,
const size_t dst_size,
const size_t num_channels )
inlinestatic

Converts audio data from one format to another and converts interleaving and byte order.

Template Parameters
SrcTypeThe source sample format.
SrcByteOrderThe source byte order. One of the structs in the byte_order namespace.
SrcInterleavingThe source interleaving. One of the structs in the interleaving namespace.
DstTypeThe destination sample format.
DstByteOrderThe destination byte order. One of the structs in the byte_order namespace.
DstInterleavingThe destination interleaving. One of the structs in the interleaving namespace.
Parameters
srcThe source data.
src_sizeThe size of the source data.
dstThe destination data.
dst_sizeThe size of the destination data.
num_channelsThe number of channels in the audio data.
Returns
True if the conversion was successful, false otherwise.

Definition at line 272 of file audio_data.hpp.

◆ convert_sample()

template<class SrcType, class SrcByteOrder, class DstType, class DstByteOrder>
void rav::AudioData::convert_sample ( const SrcType * src,
DstType * dst )
inlinestatic

Converts a sample from one format to another.

Template Parameters
SrcTypeThe source sample format. One of the structs in the format namespace.
SrcByteOrderThe source byte order. One of the structs in the byte_order namespace.
DstTypeThe destination sample format. One of the structs in the format namespace.
DstByteOrderThe destination byte order. One of the structs in the byte_order namespace.
Parameters
srcThe source data.
dstThe destination data.

Definition at line 179 of file audio_data.hpp.

◆ de_interleave()

void rav::AudioData::de_interleave ( const BufferView< uint8_t > input_buffer,
const BufferView< uint8_t > output_buffer,
const size_t num_channels,
const size_t bytes_per_sample )
inlinestatic

Converts interleaved audio data to non-interleaved audio data.

Parameters
input_bufferThe input buffer.
output_bufferThe output buffer.
num_channelsThe number of channels in the audio data.
bytes_per_sampleThe number of bytes per sample.
Returns
True if the conversion was successful, false otherwise.

Definition at line 438 of file audio_data.hpp.

◆ interleave()

void rav::AudioData::interleave ( const BufferView< uint8_t > input_buffer,
const BufferView< uint8_t > output_buffer,
const size_t num_channels,
const size_t bytes_per_sample,
const size_t num_frames )
inlinestatic

Converts non-interleaved audio data to interleaved audio data.

Parameters
input_bufferThe input buffer.
output_bufferThe output buffer.
num_channelsThe number of channels in the audio data.
bytes_per_sampleThe number of bytes per sample.
num_framesThe number of frames in the input buffer.
Returns
True if the conversion was successful, false otherwise.

Definition at line 471 of file audio_data.hpp.


The documentation for this class was generated from the following file: