Switchboard Extension SDK
Loading...
Searching...
No Matches
AudioBus.hpp
1//
2// AudioBus.hpp
3// SwitchboardSDK
4//
5// Created by Balázs Kiss on 2022. 03. 19..
6// Copyright © 2022. Synervoz Inc. All rights reserved.
7//
8
9#pragma once
10
11#include "AudioBuffer.hpp"
12#include "AudioBusFormat.hpp"
13#include <switchboard/export.h>
14
15namespace switchboard {
16
22struct SWITCHBOARDSDK_EXPORT AudioBus {
28
32 AudioBus() = default;
33
40
46 [[nodiscard]] AudioBusFormat getFormat() const;
47
53 void setFormat(const AudioBusFormat& newFormat);
54
61
67 void setBuffer(AudioBuffer<float>* newBuffer);
68
74 [[nodiscard]] bool isConnected() const;
75
79 void copyFrom(const AudioBus& srcAudioBus);
80
84 void clear();
85
86private:
87 AudioBusFormat format;
88};
89
90}
Provides an abstraction around raw audio buffers stored in memory.
Definition AudioBuffer.hpp:22
Describes the format of an AudioBus instance without the need for the audio data.
Definition AudioBusFormat.hpp:23
bool isConnected() const
Checks if the audio bus is connected to another audio bus.
void setFormat(const AudioBusFormat &newFormat)
Sets the format of the audio bus.
void setBuffer(AudioBuffer< float > *newBuffer)
Sets the audio buffer of the audio bus.
AudioBus()=default
Default audioBus constructor.
AudioBusFormat getFormat() const
Gets the format of the audio bus.
void clear()
Sets the content of the audio bus to zero.
AudioBus(AudioBuffer< float > *buffer)
AudioBus constructor.
AudioBuffer< float > * buffer
The audio buffer that contains the audio data.
Definition AudioBus.hpp:27
AudioBuffer< float > * getBuffer() const
Gets the audio buffer of the audio bus.
void copyFrom(const AudioBus &srcAudioBus)
Copies another AudioBus instance.