Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
switchboard::AudioBufferConverter Class Reference

Converts AudioBuffer class instances between different formats. More...

#include <AudioBufferConverter.hpp>

Static Public Member Functions

static void floatToShortInt (const AudioBuffer< float > &inputBuffer, AudioBuffer< int16 > &outputBuffer)
 Converts float AudioBuffer to int16 AudioBuffer.
 
static void shortIntToFloat (const AudioBuffer< int16 > &inputBuffer, AudioBuffer< float > &outputBuffer)
 Converts int16 AudioBuffer to float AudioBuffer.
 
template<typename T >
static void interleave (const AudioBuffer< T > &inputBuffer, AudioBuffer< T > &outputBuffer)
 Interleaves input buffer channels into output buffer.
 
template<typename T >
static void deinterleave (const AudioBuffer< T > &inputBuffer, AudioBuffer< T > &outputBuffer)
 Deinterleaves input buffer into output buffer channels.
 
template<typename T >
static void monoToMultichannel (const AudioBuffer< T > &inputBuffer, AudioBuffer< T > &outputBuffer)
 Copies mono input data into multiple channels of output.
 
template<typename T >
static void multichannelToMono (const AudioBuffer< T > &inputBuffer, AudioBuffer< T > &outputBuffer, const bool normalize)
 Mixes multichannel input data into mono output.
 

Detailed Description

Converts AudioBuffer class instances between different formats.

AudioBufferConverter class.

Member Function Documentation

◆ deinterleave()

template<typename T >
template void switchboard::AudioBufferConverter::deinterleave< float > ( const AudioBuffer< T > &  inputBuffer,
AudioBuffer< T > &  outputBuffer 
)
static

Deinterleaves input buffer into output buffer channels.

Input and output buffers must have the same number of channels. Input and output buffers must have the same number of frames.

Parameters
inputBufferAudioBuffer to be deinterleaved. Must be interleaved.
outputBufferAudioBuffer to store input data. Must be non-interleaved.

◆ floatToShortInt()

void switchboard::AudioBufferConverter::floatToShortInt ( const AudioBuffer< float > &  inputBuffer,
AudioBuffer< int16 > &  outputBuffer 
)
static

Converts float AudioBuffer to int16 AudioBuffer.

Input and output buffers must have the same number of channels. Input and output buffers must have the same number of frames.

Parameters
inputBufferThe float AudioBuffer that needs to be converted.
outputBufferThe int16 AudioBuffer that will store the converted data.

◆ interleave()

template<typename T >
template void switchboard::AudioBufferConverter::interleave< float > ( const AudioBuffer< T > &  inputBuffer,
AudioBuffer< T > &  outputBuffer 
)
static

Interleaves input buffer channels into output buffer.

Input and output buffers must have the same number of channels. Input and output buffers must have the same number of frames.

Parameters
inputBufferAudioBuffer to be interleaved. Must be non-interleaved.
outputBufferAudioBuffer to store input data. Must be interleaved.

◆ monoToMultichannel()

template<typename T >
template void switchboard::AudioBufferConverter::monoToMultichannel< float > ( const AudioBuffer< T > &  inputBuffer,
AudioBuffer< T > &  outputBuffer 
)
static

Copies mono input data into multiple channels of output.

Input buffer must be mono. Input and output buffers must have the same number of frames.

Parameters
inputBufferAudioBuffer whose mono channel will be placed into multiple channels. Must be mono.
outputBufferAudioBuffer in which the input data will be placed.

◆ multichannelToMono()

template<typename T >
template void switchboard::AudioBufferConverter::multichannelToMono< float > ( const AudioBuffer< T > &  inputBuffer,
AudioBuffer< T > &  outputBuffer,
const bool  normalize 
)
static

Mixes multichannel input data into mono output.

Input and output buffers must have the same number of frames.

Parameters
inputBufferAudioBuffer whose channels will be merged into a mono channel.
outputBufferAudioBuffer in which the input data will be placed. Must be mono.
normalizeTrue if the signals have to be normalized to the largest signal after mixing.

◆ shortIntToFloat()

void switchboard::AudioBufferConverter::shortIntToFloat ( const AudioBuffer< int16 > &  inputBuffer,
AudioBuffer< float > &  outputBuffer 
)
static

Converts int16 AudioBuffer to float AudioBuffer.

Input and output buffers must have the same number of channels. Input and output buffers must have the same number of frames.

Parameters
inputBufferThe int16 AudioBuffer that needs to be converted.
outputBufferThe float AudioBuffer that will store the converted data.

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