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

AudioGraphResampler class. More...

#include <AudioGraphResampler.hpp>

Public Types

using ProcessCallback = std::function<bool(AudioBusList& inAudioBuses, AudioBusList& outAudioBuses)>
 Callback function type for processing audio data.
 

Public Member Functions

 AudioGraphResampler (int sampleRate, int bufferSize)
 Constructor for AudioGraphResampler.
 
 ~AudioGraphResampler ()
 Destructor for AudioGraphResampler.
 
void setProcessCallback (ProcessCallback callback)
 Sets the process callback function.
 
bool setNumberOfBuses (const uint numberOfInputBuses, const uint numberOfOutputBuses)
 Sets the number of input and output buses.
 
bool process (AudioBusList &inAudioBuses, AudioBusList &outAudioBuses)
 Processes the audio data.
 

Detailed Description

AudioGraphResampler class.

This class is responsible for providing a constant sample rate and buffer size for the audio graph.

Member Typedef Documentation

◆ ProcessCallback

using switchboard::AudioGraphResampler::ProcessCallback = std::function<bool(AudioBusList& inAudioBuses, AudioBusList& outAudioBuses)>

Callback function type for processing audio data.

Parameters
inAudioBusesThe input audio buses.
outAudioBusesThe output audio buses.
Returns
True if the processing was successful, false otherwise.

Constructor & Destructor Documentation

◆ AudioGraphResampler()

switchboard::AudioGraphResampler::AudioGraphResampler ( int sampleRate,
int bufferSize )

Constructor for AudioGraphResampler.

Parameters
sampleRateThe fixed processing sample rate to be used in the callback.
bufferSizeThe fixed processing buffer size to be used in the callback.

Member Function Documentation

◆ process()

bool switchboard::AudioGraphResampler::process ( AudioBusList & inAudioBuses,
AudioBusList & outAudioBuses )

Processes the audio data.

Parameters
inAudioBusesThe input audio buses.
outAudioBusesThe output audio buses.
Returns
True if the processing was successful, false otherwise.

◆ setNumberOfBuses()

bool switchboard::AudioGraphResampler::setNumberOfBuses ( const uint numberOfInputBuses,
const uint numberOfOutputBuses )

Sets the number of input and output buses.

Parameters
numberOfInputBusesThe number of input buses.
numberOfOutputBusesThe number of output buses.
Returns
True if the operation was successful, false otherwise.

◆ setProcessCallback()

void switchboard::AudioGraphResampler::setProcessCallback ( ProcessCallback callback)

Sets the process callback function.

Parameters
callbackThe process callback function.