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

Analyzes the incoming audio and checks whether there was any voice activity. More...

#include <VoiceActivityDetectorNode.hpp>

Inheritance diagram for switchboard::VoiceActivityDetectorNode:

Public Member Functions

SB_WASM VoiceActivityDetectorNode ()
 Creates a VoiceActivityDetectorNode instance.
 
bool getIsEnabled () const
 Checks if the node is enabled.
 
void setIsEnabled (const bool isEnabled)
 Enables or disables the node.
 
SB_WASM VoiceActivityDetector::Status getStatus ()
 Returns the last buffers VAD status.
 
SB_WASM void setHangoverDuration (float duration)
 Sets the duration of the VAD hangover.
 
SB_WASM float getHangoverDuration () const
 Returns the current hangover duration.
 
SB_WASM void setGainTriggerThreshold (float threshold)
 Sets the audio level trigger amount for the VAD.
 
SB_WASM float getGainTriggerThreshold () const
 Returns the current audio level trigger threshold.
 
SB_WASM void setTriggerDuration (float duration)
 Sets the amount of seconds the audio signal must be higher than the trigger threshold for the VAD to be activated.
 
SB_WASM float getTriggerDuration () const
 Returns the current trigger duration.
 
void setVoiceActivityCallback (const VoiceActivityCallback &callback)
 
SB_WASM bool setBusFormat (AudioBusFormat &busFormat) override
 
SB_WASM bool consume (AudioBus &bus) override
 

Detailed Description

Analyzes the incoming audio and checks whether there was any voice activity.

VoiceActivityDetectorNode class

Member Function Documentation

◆ getGainTriggerThreshold()

float switchboard::VoiceActivityDetectorNode::getGainTriggerThreshold ( ) const

Returns the current audio level trigger threshold.

Returns
Trigger threshold.

◆ getHangoverDuration()

float switchboard::VoiceActivityDetectorNode::getHangoverDuration ( ) const

Returns the current hangover duration.

Returns
Hangover duration.

◆ getIsEnabled()

bool switchboard::VoiceActivityDetectorNode::getIsEnabled ( ) const

Checks if the node is enabled.

Returns
True if the node is enabled.

◆ getStatus()

VoiceActivityDetector::Status switchboard::VoiceActivityDetectorNode::getStatus ( )

Returns the last buffers VAD status.

Returns
The last VAD status.

◆ getTriggerDuration()

float switchboard::VoiceActivityDetectorNode::getTriggerDuration ( ) const

Returns the current trigger duration.

Returns
Trigger duration.

◆ setGainTriggerThreshold()

void switchboard::VoiceActivityDetectorNode::setGainTriggerThreshold ( float threshold)

Sets the audio level trigger amount for the VAD.

Parameters
thresholdThe new threshold.

◆ setHangoverDuration()

void switchboard::VoiceActivityDetectorNode::setHangoverDuration ( float duration)

Sets the duration of the VAD hangover.

Parameters
durationThe new duration.

◆ setIsEnabled()

void switchboard::VoiceActivityDetectorNode::setIsEnabled ( const bool isEnabled)

Enables or disables the node.

Parameters
isEnabledTrue if the node is enabled.

◆ setTriggerDuration()

void switchboard::VoiceActivityDetectorNode::setTriggerDuration ( float duration)

Sets the amount of seconds the audio signal must be higher than the trigger threshold for the VAD to be activated.

Parameters
durationThe new duration.