Switchboard Extension SDK
Loading...
Searching...
No Matches
switchboard::AudioBus Struct Reference

Represents a stream of audio in one direction. More...

#include <AudioBus.hpp>

Public Member Functions

 AudioBus ()=default
 Default audioBus constructor.
 AudioBus (AudioBuffer< float > *buffer)
 AudioBus constructor.
AudioBusFormat getFormat () const
 Gets the format of the audio bus.
void setFormat (const AudioBusFormat &newFormat)
 Sets the format of the audio bus.
SB_WASM AudioBuffer< float > * getBuffer () const
 Gets the audio buffer of the audio bus.
SB_WASM void setBuffer (AudioBuffer< float > *newBuffer)
 Sets the audio buffer of the audio bus.
bool isConnected () const
 Checks if the audio bus is connected to another audio bus.
SB_WASM void copyFrom (const AudioBus &srcAudioBus)
 Copies another AudioBus instance.
void clear ()
 Sets the content of the audio bus to zero.

Public Attributes

AudioBuffer< float > * buffer = nullptr
 The audio buffer that contains the audio data.

Detailed Description

Represents a stream of audio in one direction.

AudioBus class.

Multiple audio buses can be handled together by the AudioBusList class.

Constructor & Destructor Documentation

◆ AudioBus()

switchboard::AudioBus::AudioBus ( AudioBuffer< float > * buffer)

AudioBus constructor.

Parameters
bufferThe audio buffer containing audio data.

Member Function Documentation

◆ getBuffer()

SB_WASM AudioBuffer< float > * switchboard::AudioBus::getBuffer ( ) const

Gets the audio buffer of the audio bus.

Returns
The audio buffer object.

◆ getFormat()

AudioBusFormat switchboard::AudioBus::getFormat ( ) const
nodiscard

Gets the format of the audio bus.

Returns
The AudioBusFormat instance describing the format of the audio bus.

◆ isConnected()

bool switchboard::AudioBus::isConnected ( ) const
nodiscard

Checks if the audio bus is connected to another audio bus.

Returns
True if the audio bus is connected, false otherwise.

◆ setBuffer()

SB_WASM void switchboard::AudioBus::setBuffer ( AudioBuffer< float > * newBuffer)

Sets the audio buffer of the audio bus.

Parameters
newBufferThe new audio buffer to be set.

◆ setFormat()

void switchboard::AudioBus::setFormat ( const AudioBusFormat & newFormat)

Sets the format of the audio bus.

Parameters
newFormatThe new AudioBusFormat to be set.

Member Data Documentation

◆ buffer

AudioBuffer<float>* switchboard::AudioBus::buffer = nullptr

The audio buffer that contains the audio data.

Deprecated
Please use getBuffer() and setBuffer() methods instead.

The documentation for this struct was generated from the following file: