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

Ducks music signal based on voice signal. Music signal has to be connected to the first input bus, ducking voice signals have to be connected to the second input bus. Output is the ducked music signal. More...

#include <MusicDuckingV2Node.hpp>

Inheritance diagram for switchboard::MusicDuckingV2Node:
switchboard::AudioProcessorNode switchboard::AudioNode

Public Member Functions

WASM float getDuckingAmount () const
 Gets the current ducking amount. Returned value is between 0 and 1.
 
WASM void setDuckingAmount (float duckingAmount)
 Sets the current ducking amount. The provided value has to be between 0 and 1, where 0 means no ducking and 1 means maximum ducking. At the value of 1, the output signal attenuated by 100dB and is inaudible.
 
WASM float getActivationThreshold () const
 Gets the current ducking amount. Returned value is between 0 and 1.
 
WASM void setActivationThreshold (float threshold)
 Sets the current activation threshold. The provided value has to be between 0 and 1.
 
WASM void setAttackSeconds (float attackSeconds)
 Sets the attack time of the ducking.
 
WASM float getAttackSeconds () const
 Gets the current attack time of the ducking.
 
WASM void setReleaseSeconds (float releaseSeconds)
 Sets the release time of the ducking.
 
WASM float getReleaseSeconds () const
 Gets the current release time of the ducking.
 
WASM void setHoldSeconds (float holdSeconds)
 Sets the hold time of the ducking.
 
WASM float getHoldSeconds () const
 Gets the current hold time of the ducking.
 
WASM bool getForcedDuckingEnabled () const
 Gets whether forced ducking is enabled.
 
WASM void setForcedDuckingEnabled (const bool newValue)
 Enables or disables forced ducking.
 
WASM bool getMixDuckingSignal () const
 Tells if the node is in mixDuckingSignal mode. If set to yes, audio trigger input will be mixed to the output.
 
WASM void setMixDuckingSignal (const bool mix)
 Sets the node to mix ducking signal mode..
 
bool setNumberOfBuses (const uint numberOfInputBuses, const uint numberOfOutputBuses) override
 Sets number of buses.
 
bool setBusFormats (AudioBusFormatList &inputBusFormats, AudioBusFormatList &outputBusFormats) override
 Sets bus formats.
 
bool process (AudioBusList &inBuses, AudioBusList &outBuses) override
 Processes audio data from the given input buses and produces the audio output to the given output buses.
 
- Public Member Functions inherited from switchboard::AudioProcessorNode
virtual ~AudioProcessorNode ()=default
 AudioProcessorNode virtual destructor.
 
- Public Member Functions inherited from switchboard::AudioNode
 AudioNode ()
 AudioNode constructor.
 
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.
 
virtual std::vector< std::unique_ptr< Parameter > > & getParameters ()
 Gets the parameters of the audio node.
 
virtual ParametergetParameter (const std::string &id)
 Gets the parameter with the given name.
 

Additional Inherited Members

- Public Attributes inherited from switchboard::AudioNode
std::string name
 The name of the audio node.
 
- Protected Member Functions inherited from switchboard::AudioNode
void initParameters (std::map< std::string, std::any > config)
 Initializes the node parameters from the given configuration values.
 
- Protected Attributes inherited from switchboard::AudioNode
std::string type
 
std::vector< std::unique_ptr< Parameter > > parameters
 

Detailed Description

Ducks music signal based on voice signal. Music signal has to be connected to the first input bus, ducking voice signals have to be connected to the second input bus. Output is the ducked music signal.

MusicDuckingV2Node class.

Member Function Documentation

◆ getActivationThreshold()

float switchboard::MusicDuckingV2Node::getActivationThreshold ( ) const

Gets the current ducking amount. Returned value is between 0 and 1.

Returns
The current ducking amount.

◆ getAttackSeconds()

float switchboard::MusicDuckingV2Node::getAttackSeconds ( ) const

Gets the current attack time of the ducking.

Returns
The attack time in seconds.

◆ getDuckingAmount()

float switchboard::MusicDuckingV2Node::getDuckingAmount ( ) const

Gets the current ducking amount. Returned value is between 0 and 1.

Returns
The current ducking amount.

◆ getForcedDuckingEnabled()

bool switchboard::MusicDuckingV2Node::getForcedDuckingEnabled ( ) const

Gets whether forced ducking is enabled.

When forced ducking is enabled, the input ducking signal is ignored and ducking is always applied.

Returns
True when forced ducking is enabled.

◆ getHoldSeconds()

float switchboard::MusicDuckingV2Node::getHoldSeconds ( ) const

Gets the current hold time of the ducking.

Returns
The hold time in seconds.

◆ getMixDuckingSignal()

bool switchboard::MusicDuckingV2Node::getMixDuckingSignal ( ) const

Tells if the node is in mixDuckingSignal mode. If set to yes, audio trigger input will be mixed to the output.

Returns
True if the node is in passthrough mode.

◆ getReleaseSeconds()

float switchboard::MusicDuckingV2Node::getReleaseSeconds ( ) const

Gets the current release time of the ducking.

Returns
The release time in seconds.

◆ process()

bool switchboard::MusicDuckingV2Node::process ( AudioBusList & inBuses,
AudioBusList & outBuses )
overridevirtual

Processes audio data from the given input buses and produces the audio output to the given output buses.

Should be overridden by subclasses.

Parameters
inBusesThe input buses that contain the audio data.
outBusesThe output buses which should be filled with the processed audio data.
Returns
True if audio was processed successfully, false otherwise.

Implements switchboard::AudioProcessorNode.

◆ setActivationThreshold()

void switchboard::MusicDuckingV2Node::setActivationThreshold ( float threshold)

Sets the current activation threshold. The provided value has to be between 0 and 1.

Parameters
thresholdThe new activation threshold.

◆ setAttackSeconds()

void switchboard::MusicDuckingV2Node::setAttackSeconds ( float attackSeconds)

Sets the attack time of the ducking.

When set to 0, the ducking is applied immediately without any ramping.

Parameters
attackSecondsThe new attack time value in seconds.

◆ setBusFormats()

bool switchboard::MusicDuckingV2Node::setBusFormats ( AudioBusFormatList & inputBusFormats,
AudioBusFormatList & outputBusFormats )
overridevirtual

Sets bus formats.

Should be overridden by subclasses. Please note that setNumberOfBuses is guaranteed to be called before this method.

Parameters
inputBusFormatsThe input bus formats to set.
outputBusFormatsThe output bus formats to set.
Returns
True if the bus formats were set successfully, false otherwise.

Implements switchboard::AudioProcessorNode.

◆ setDuckingAmount()

void switchboard::MusicDuckingV2Node::setDuckingAmount ( float duckingAmount)

Sets the current ducking amount. The provided value has to be between 0 and 1, where 0 means no ducking and 1 means maximum ducking. At the value of 1, the output signal attenuated by 100dB and is inaudible.

Parameters
duckingAmountThe new amount.

◆ setForcedDuckingEnabled()

void switchboard::MusicDuckingV2Node::setForcedDuckingEnabled ( const bool newValue)

Enables or disables forced ducking.

Parameters
newValueTrue when it is enabled, false when it is not.

◆ setHoldSeconds()

void switchboard::MusicDuckingV2Node::setHoldSeconds ( float holdSeconds)

Sets the hold time of the ducking.

Parameters
holdSecondsThe new hold time value in seconds.

◆ setMixDuckingSignal()

void switchboard::MusicDuckingV2Node::setMixDuckingSignal ( const bool mix)

Sets the node to mix ducking signal mode..

Parameters
mixThe new value.

◆ setNumberOfBuses()

bool switchboard::MusicDuckingV2Node::setNumberOfBuses ( const uint numberOfInputBuses,
const uint numberOfOutputBuses )
overridevirtual

Sets number of buses.

Should be overridden by subclasses

Parameters
numberOfInputBusesThe number of input buses to set.
numberOfOutputBusesThe number of output buses to set.
Returns
True for valid number of buses, false otherwise.

Implements switchboard::AudioProcessorNode.

◆ setReleaseSeconds()

void switchboard::MusicDuckingV2Node::setReleaseSeconds ( float releaseSeconds)

Sets the release time of the ducking.

When set to 0, the ducking is disabled immediately without any ramping.

Parameters
releaseSecondsThe new release time value in seconds.