Switchboard SDK
Loading...
Searching...
No Matches
switchboard::WavEncoder Class Reference

Encodes WAV data from PCM audio data. More...

#include <WavEncoder.hpp>

Static Public Member Functions

template<typename T >
static const std::vector< uint8 > encode (const AudioBuffer< T > &inputBuffer, const uint sampleRate)
 
template<typename T >
static const std::vector< uint8 > encode (const std::vector< T > &inputData, const uint sampleRate, const uint numChannels)
 

Detailed Description

Encodes WAV data from PCM audio data.

WavEncoder class.

Member Function Documentation

◆ encode() [1/2]

template<typename T >
const std::vector< uint8 > switchboard::WavEncoder::encode ( const AudioBuffer< T > & inputBuffer,
const uint sampleRate )
static

Encodes inputBuffer and puts into a Wav format vector from PCM data.

Parameters
inputBufferThe interleaved input buffer to encode.
sampleRateThe sample rate of input data.
Returns
The output Wav data in a vector.

◆ encode() [2/2]

template<typename T >
const std::vector< uint8 > switchboard::WavEncoder::encode ( const std::vector< T > & inputData,
const uint sampleRate,
const uint numChannels )
static

Encodes inputData and puts into a Wav format vector from PCM data.

Parameters
inputDataThe input data to encode.
sampleRateThe sample rate of input data.
numChannelsThe number of channels.
Returns
The output Wav data in a vector.