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

Voice Activity Detector. More...

#include <VoiceActivityDetector.hpp>

Public Types

enum class  Status { VoiceDetected = 0 , Hangover = 1 , Idle = 2 }
 

Public Member Functions

 VoiceActivityDetector ()
 Voice Activity Detector constructor.
 
Status process (AudioBuffer< float > &inputBuffer)
 Processes an audio buffer and returns the new VAD status.
 
void setHangoverDuration (float duration)
 Sets the duration of the VAD hangover in seconds.
 
float getHangoverDuration () const
 Returns the current hangover duration in seconds.
 
void setGainTriggerThreshold (float threshold)
 Sets the audio level trigger amount for the VAD.
 
float getGainTriggerThreshold () const
 Returns the current audio level trigger threshold.
 
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.
 
float getTriggerDuration () const
 Returns the current trigger duration.
 

Detailed Description

Voice Activity Detector.

Member Function Documentation

◆ getGainTriggerThreshold()

float switchboard::VoiceActivityDetector::getGainTriggerThreshold ( ) const

Returns the current audio level trigger threshold.

Returns
Trigger threshold.

◆ getHangoverDuration()

float switchboard::VoiceActivityDetector::getHangoverDuration ( ) const

Returns the current hangover duration in seconds.

Returns
Hangover duration in seconds.

◆ getTriggerDuration()

float switchboard::VoiceActivityDetector::getTriggerDuration ( ) const

Returns the current trigger duration.

Returns
Trigger duration.

◆ process()

VoiceActivityDetector::Status switchboard::VoiceActivityDetector::process ( AudioBuffer< float > & inputBuffer)

Processes an audio buffer and returns the new VAD status.

Parameters
inputBufferThe input audio buffer.
Returns
The VAD status.

◆ setGainTriggerThreshold()

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

Sets the audio level trigger amount for the VAD.

Parameters
thresholdThe new threshold.

◆ setHangoverDuration()

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

Sets the duration of the VAD hangover in seconds.

Parameters
durationThe new duration in seconds.

◆ setTriggerDuration()

void switchboard::VoiceActivityDetector::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.