PocketSphinx 5.1.0
A small speech recognizer
Loading...
Searching...
No Matches
Macros | Typedefs
endpointer.h File Reference

VAD-based endpointer for PocketSphinx. More...

#include <pocketsphinx/prim_type.h>
#include <pocketsphinx/export.h>
#include <pocketsphinx/vad.h>

Go to the source code of this file.

Macros

#define PS_ENDPOINTER_DEFAULT_WINDOW   0.3
 
#define PS_ENDPOINTER_DEFAULT_RATIO   0.9
 
#define ps_endpointer_frame_size(ep)   ps_vad_frame_size(ps_endpointer_vad(ep))
 
#define ps_endpointer_frame_length(ep)   ps_vad_frame_length(ps_endpointer_vad(ep))
 
#define ps_endpointer_sample_rate(ep)   ps_vad_sample_rate(ps_endpointer_vad(ep))
 

Typedefs

typedef struct ps_endpointer_s ps_endpointer_t
 
typedef double(* ps_endpointer_timestamp_cb_t) (void *user_data)
 

Detailed Description

VAD-based endpointer for PocketSphinx.

Because doxygen is Bad Software, the actual documentation can only exist in ps_endpointer_t. Sorry about that.

Macro Definition Documentation

◆ PS_ENDPOINTER_DEFAULT_WINDOW

#define PS_ENDPOINTER_DEFAULT_WINDOW   0.3

Default window in seconds of audio to use for speech start/end decision.

◆ PS_ENDPOINTER_DEFAULT_RATIO

#define PS_ENDPOINTER_DEFAULT_RATIO   0.9

Default ratio of frames in window to trigger start/end decision.

◆ ps_endpointer_frame_size

#define ps_endpointer_frame_size (   ep)    ps_vad_frame_size(ps_endpointer_vad(ep))

Get the frame size (in samples) consumed by the endpointer.

Multiply this by 2 to get the size of the frame buffer required.

Examples
live.c, live_portaudio.c, live_pulseaudio.c, and live_win32.c.

◆ ps_endpointer_frame_length

#define ps_endpointer_frame_length (   ep)    ps_vad_frame_length(ps_endpointer_vad(ep))

Get the frame length (in seconds) consumed by the endpointer.

◆ ps_endpointer_sample_rate

#define ps_endpointer_sample_rate (   ep)    ps_vad_sample_rate(ps_endpointer_vad(ep))

Get the sample rate required by the endpointer.

Examples
live.c, and live_win32.c.

Typedef Documentation

◆ ps_endpointer_timestamp_cb_t

typedef double(* ps_endpointer_timestamp_cb_t) (void *user_data)

Callback function type for external timestamp sources.

This callback allows applications to provide their own timestamp source (e.g., system time, monotonic clock) to avoid timestamp drift between audio clock and system clock.

Parameters
user_dataUser-provided data passed to ps_endpointer_set_timestamp_func()
Returns
Current timestamp in seconds