Switchboard SDK
Loading...
Searching...
No Matches
switchboard::AudioDevice Class Referenceabstract

Represents an audio device that can send and receive audio data. More...

#include <AudioDevice.hpp>

Public Member Functions

virtual uint getSampleRate ()=0
 
virtual uint getNumChannels ()=0
 
virtual bool isCapturing ()=0
 
virtual void writeCaptureData (void *data, uint32_t numberOfSamples)=0
 
virtual bool isRendering ()=0
 
virtual uint32_t readRenderData (void *data, uint32_t numberOfSamples)=0
 

Detailed Description

Represents an audio device that can send and receive audio data.

AudioDevice class.

Member Function Documentation

◆ getNumChannels()

virtual uint switchboard::AudioDevice::getNumChannels ( )
pure virtual

Gets the number of channels of the audio device.

Returns
The number of channels of the audio device.

◆ getSampleRate()

virtual uint switchboard::AudioDevice::getSampleRate ( )
pure virtual

Gets the sample rate of the audio device.

Returns
The sample rate of the audio device.

◆ isCapturing()

virtual bool switchboard::AudioDevice::isCapturing ( )
pure virtual

Gets whether the audio device can receive any audio.

Returns
True, if the audio device can receive data, false otherwise.

◆ isRendering()

virtual bool switchboard::AudioDevice::isRendering ( )
pure virtual

Gets whether the audio device has any data to provide.

Returns
True, if the audio device can provide data, false otherwise.

◆ readRenderData()

virtual uint32_t switchboard::AudioDevice::readRenderData ( void * data,
uint32_t numberOfSamples )
pure virtual

Renders the audio data into an audio buffer.

Parameters
dataPointer to the memory where the data will be written.
numberOfSamplesThe number of samples requested from the audio device.
Returns
The number of samples that was written by the audio device.

◆ writeCaptureData()

virtual void switchboard::AudioDevice::writeCaptureData ( void * data,
uint32_t numberOfSamples )
pure virtual

Writes the audio data into the audio device.

Parameters
dataPointer to the memory where the audio data is stored.
numberOfSamplesThe number of samples in the audio buffer.