Photon Voice v2.53

Public Member Functions | Protected Attributes | Properties | Events | List of all members
AudioUtil.VoiceDetector< T > Class Template Referenceabstract

Simple voice activity detector triggered by signal level. More...

Inherits IProcessor< T >, and AudioUtil.IVoiceDetector.

Public Member Functions

abstract T[] Process (T[] buf)
 Process a frame of data. More...
 
void Dispose ()
 

Protected Attributes

float norm
 
float threshold
 
int activityDelay
 
int autoSilenceCounter = 0
 
int valuesCountPerSec
 
int activityDelayValuesCount
 

Properties

bool On [get, set]
 If true, voice detection enabled. More...
 
float Threshold [get, set]
 Voice detected as soon as signal level exceeds threshold. More...
 
bool Detected [get, protected set]
 If true, voice detected. More...
 
DateTime DetectedTime [get]
 Last time when switched to detected state. More...
 
int ActivityDelayMs [get, set]
 Keep detected state during this time after signal level dropped below threshold. More...
 
- Properties inherited from AudioUtil.IVoiceDetector
bool On [get, set]
 If true, voice detection enabled. More...
 
float Threshold [get, set]
 Voice detected as soon as signal level exceeds threshold. More...
 
bool Detected [get]
 If true, voice detected. More...
 
DateTime DetectedTime [get]
 Last time when switched to detected state. More...
 
int ActivityDelayMs [get, set]
 Keep detected state during this time after signal level dropped below threshold. More...
 

Events

Action OnDetected
 Called when switched to detected state. More...
 
- Events inherited from AudioUtil.IVoiceDetector
Action OnDetected
 Called when switched to detected state. More...
 

Detailed Description

Simple voice activity detector triggered by signal level.

Member Function Documentation

◆ Process()

abstract T [] Process ( T[]  buf)
pure virtual

Process a frame of data.

Parameters
bufBuffer containing input data
Returns
Buffer containing output data or null if frame has been discarded (VAD)

Implements IProcessor< T >.

Property Documentation

◆ ActivityDelayMs

int ActivityDelayMs
getset

Keep detected state during this time after signal level dropped below threshold.

◆ Detected

bool Detected
getprotected set

If true, voice detected.

◆ DetectedTime

DateTime DetectedTime
get

Last time when switched to detected state.

◆ On

bool On
getset

If true, voice detection enabled.

◆ Threshold

float Threshold
getset

Voice detected as soon as signal level exceeds threshold.

Event Documentation

◆ OnDetected

Action OnDetected

Called when switched to detected state.