11#include <switchboard/export.h>
12#include <switchboard_core/SwitchboardCore.hpp>
14namespace switchboard {
34 uint numberOfChannels,
39 ) SWITCHBOARD_REALTIME;
49 AudioBuffer(uint numberOfChannels, uint numberOfFrames, uint sampleRate, T* data) SWITCHBOARD_REALTIME;
98 bool isMono() const SWITCHBOARD_REALTIME;
108 T
getSample(uint channel, uint sampleIndex) const SWITCHBOARD_REALTIME;
117 void setSample(uint channel, uint sampleIndex, T value) SWITCHBOARD_REALTIME;
165 uint numberOfChannels;
172 uint getBufferSizeBytes() const SWITCHBOARD_REALTIME;
173 uint getNumberOfBuffers() const SWITCHBOARD_REALTIME;
uint getSampleRate() const SWITCHBOARD_REALTIME
Gets the sample rate of the audio buffer.
bool getIsInterleaved() const SWITCHBOARD_REALTIME
Returns whether the audio buffer contains interleaved or non-interleaved data. Always false if the au...
void clear() SWITCHBOARD_REALTIME
Sets all audio sample values to zero.
T getSample(uint channel, uint sampleIndex) const SWITCHBOARD_REALTIME
Returns a sample value from the audio buffer.
T * getWritePointer(uint channel) SWITCHBOARD_REALTIME
Returns a write pointer to the data for a channel in the audio buffer.
AudioBuffer(uint numberOfChannels, uint numberOfFrames, uint sampleRate, T *data) SWITCHBOARD_REALTIME
Creates a mono or interleaved AudioBuffer instance from already allocated memory.
AudioBuffer(uint numberOfChannels, uint numberOfFrames, bool isInterleaved, uint sampleRate, T **data) SWITCHBOARD_REALTIME
Creates an AudioBuffer instance from already allocated memory.
void setNumberOfFrames(const uint newNumberOfFrames) SWITCHBOARD_REALTIME
Sets the number of frames in the buffer.
void copyFrom(const AudioBuffer< T > &srcBuffer) SWITCHBOARD_REALTIME
Copies data from another AudioBuffer instance.
void setSample(uint channel, uint sampleIndex, T value) SWITCHBOARD_REALTIME
Sets a sample value in the audio buffer.
const T * getReadPointer(uint channel) const SWITCHBOARD_REALTIME
Returns a read pointer to the data for a channel in the audio buffer.
uint getNumberOfFrames() const SWITCHBOARD_REALTIME
Returns the number of frames stored in the audio buffer.
bool isMono() const SWITCHBOARD_REALTIME
Returns whether the audio buffer is mono.
void setSampleRate(const uint newSampleRate) SWITCHBOARD_REALTIME
Sets the sample rate of the audio buffer.
uint getNumberOfChannels() const SWITCHBOARD_REALTIME
Returns the number of channels stored in the audio buffer.