Switchboard SDK
Loading...
Searching...
No Matches
switchboard::SineGeneratorNode Class Reference

Generates a sine wave with the given frequency and amplitude. More...

#include <SineGeneratorNode.hpp>

Inheritance diagram for switchboard::SineGeneratorNode:

Public Member Functions

 SineGeneratorNode (const std::map< std::string, std::any > &config)
 Creates a SineGeneratorNode instance.
 
SB_WASM float getFrequency () const
 Gets the current frequency value of the generated sine wave.
 
SB_WASM void setFrequency (const float frequency)
 Sets the frequency of the generated sine wave.
 
SB_WASM float getAmplitude () const
 Gets the current amplitude value of the generated sine wave.
 
SB_WASM void setAmplitude (const float amplitude)
 Sets the amplitude of the generated sine wave.
 
SB_WASM bool setBusFormat (AudioBusFormat &busFormat) override
 
SB_WASM bool produce (AudioBus &bus) override
 

Detailed Description

Generates a sine wave with the given frequency and amplitude.

SineGeneratorNode class.

Constructor & Destructor Documentation

◆ SineGeneratorNode()

switchboard::SineGeneratorNode::SineGeneratorNode ( const std::map< std::string, std::any > & config)

Creates a SineGeneratorNode instance.

Parameters
configConfiguration map for the node.

Member Function Documentation

◆ getAmplitude()

float switchboard::SineGeneratorNode::getAmplitude ( ) const

Gets the current amplitude value of the generated sine wave.

Returns
The amplitude value.

◆ getFrequency()

float switchboard::SineGeneratorNode::getFrequency ( ) const

Gets the current frequency value of the generated sine wave.

Returns
The frequency value in Hz.

◆ setAmplitude()

void switchboard::SineGeneratorNode::setAmplitude ( const float amplitude)

Sets the amplitude of the generated sine wave.

Parameters
amplitudeThe new amplitude value. Should be between 0 and 1.

◆ setFrequency()

void switchboard::SineGeneratorNode::setFrequency ( const float frequency)

Sets the frequency of the generated sine wave.

Parameters
frequencyThe new frequency value in Hz.