PocketSphinx  5.0.0 A small speech recognizer

Voice activity detector. More...

#include <pocketsphinx/vad.h>

## Detailed Description

Voice activity detector.

## Member Function Documentation

Initialize voice activity detection.

Parameters
 mode "Aggressiveness" of voice activity detection. Stricter values (see ps_vad_mode_t) are less likely to misclassify non-speech as speech. sample_rate Sampling rate of input, or 0 for default (which can be obtained with ps_vad_sample_rate()). Only 8000, 16000, 32000, 48000 are directly supported. See ps_vad_set_input_params() for more information. frame_length Frame length in seconds, or 0.0 for the default. Only 0.01, 0.02, 0.03 currently supported. Actual value may differ, you must use ps_vad_frame_length() to obtain it.
Returns
VAD object or NULL on failure (invalid parameter for instance).

Retain a pointer to voice activity detector.

Parameters
Returns
Voice activity detector with incremented reference count.

Release a pointer to voice activity detector.

Parameters
Returns
New reference count (0 if freed).

Set the input parameters for voice activity detection.

Parameters
 sample_rate Sampling rate of input, or 0 for default (which can be obtained with ps_vad_sample_rate()). Only 8000, 16000, 32000, 48000 are directly supported, others will use the closest supported rate (within reason). Note that this means that the actual frame length may not be exactly the one requested, so you must always use the one returned by ps_vad_frame_size() (in samples) or ps_vad_frame_length() (in seconds). frame_length Requested frame length in seconds, or 0.0 for the default. Only 0.01, 0.02, 0.03 currently supported. Actual frame length may be different, you must always use ps_vad_frame_length() to obtain it.
Returns
0 for success or -1 on error.

Get the sampling rate expected by voice activity detection.

Parameters
Returns
Expected sampling rate.

Get the number of samples expected by voice activity detection.

You must always ensure that the buffers passed to ps_vad_classify() contain this number of samples (zero-pad them if necessary).

Parameters
Returns
Size, in samples, of the frames passed to ps_vad_classify().