Generates a sine wave with the given frequency and amplitude. More...
#include <SineGeneratorNode.hpp>
Public Member Functions | |
WASM | SineGeneratorNode () |
Creates a SineGeneratorNode instance. | |
WASM float | getFrequency () const |
Gets the current frequency value of the generated sine wave. | |
WASM void | setFrequency (const float frequency) |
Sets the frequency of the generated sine wave. | |
WASM float | getAmplitude () const |
Gets the current amplitude value of the generated sine wave. | |
WASM void | setAmplitude (const float amplitude) |
Sets the amplitude of the generated sine wave. | |
WASM bool | setBusFormat (AudioBusFormat &busFormat) override |
Sets bus format. | |
WASM bool | produce (AudioBus &bus) override |
Produces audio data in the given bus. | |
![]() | |
virtual bool | setBusFormat (AudioBusFormat &busFormat)=0 |
Sets bus format. | |
virtual bool | produce (AudioBus &bus)=0 |
Produces audio data in the given bus. | |
bool | setNumberOfBuses (const uint numberOfBuses) override |
Sets number of buses. | |
bool | setBusFormats (AudioBusFormatList &busFormats) override |
Sets bus formats. | |
bool | produce (AudioBusList &buses) override |
Produces audio data in the given buses. | |
virtual bool | setNumberOfBuses (const uint numberOfBuses)=0 |
Sets number of buses. | |
virtual bool | setBusFormats (AudioBusFormatList &busFormats)=0 |
Sets bus formats. | |
virtual bool | produce (AudioBusList &buses)=0 |
Produces audio data in the given buses. | |
![]() | |
virtual | ~AudioNode ()=default |
AudioNode virtual destructor. | |
const std::string & | getType () const |
Gets the type of the audio node. | |
virtual const std::string | getDisplayName () const |
Gets the display name of the audio node. | |
Additional Inherited Members | |
![]() | |
std::string | name |
The name of the audio node. | |
![]() | |
std::string | type |
Generates a sine wave with the given frequency and amplitude.
SineGeneratorNode class.
float switchboard::SineGeneratorNode::getAmplitude | ( | ) | const |
Gets the current amplitude value of the generated sine wave.
float switchboard::SineGeneratorNode::getFrequency | ( | ) | const |
Gets the current frequency value of the generated sine wave.
|
overridevirtual |
Produces audio data in the given bus.
Should be overridden by subclasses.
bus | The bus that should be filled with audio data. |
Implements switchboard::SingleBusAudioSourceNode.
void switchboard::SineGeneratorNode::setAmplitude | ( | const float | amplitude | ) |
Sets the amplitude of the generated sine wave.
amplitude | The new amplitude value. Should be between 0 and 1. |
|
overridevirtual |
Sets bus format.
Should be overridden by subclasses.
busFormat | The bus format to set. |
Implements switchboard::SingleBusAudioSourceNode.
void switchboard::SineGeneratorNode::setFrequency | ( | const float | frequency | ) |
Sets the frequency of the generated sine wave.
frequency | The new frequency value in Hz. |