cont_ad_t Struct Reference

Continuous listening module or object Continuous listening module or object. More...

`#include <cont_ad.h>`

## Data Fields

int32(* | adfunc )(ad_rec_t *ad, int16 *buf, int32 max)
ad_rec_t * | ad
| A/D device argument for adfunc. More...
int32 | rawmode
| Pass all input data through, without filtering silence.
int16 * | adbuf
| Circular buffer for maintaining A/D data read until consumed.
int32 | state
| State of data returned by most recent cont_ad_read call; CONT_AD_STATE_SIL or CONT_AD_STATE_SPEECH. More...
int32 | read_ts
| Absolute timestamp (total no. More...
int32 | seglen
| Total no. More...
int32 | siglvl
| Max signal level for the data consumed by the most recent cont_ad_read call (dB range: 0-99). More...
int32 | sps
| Samples/sec; moved from ad->sps to break dependence on ad by N. More...
int32 | eof
| Whether the source ad device has encountered EOF.
int32 | spf
| Samples/frame; audio level is analyzed within frames.
int32 | adbufsize
| Buffer size (Number of samples)
int32 | prev_sample
| For pre-emphasis filter.
int32 | headfrm
| Frame number in adbuf with unconsumed A/D data.
int32 | n_frm
| Number of complete frames of unconsumed A/D data in adbuf.
int32 | n_sample
| Number of samples of unconsumed data in adbuf.
int32 | tot_frm
| Total number of frames of A/D data read, including consumed ones.
int32 | noise_level
| PWP: what we claim as the "current" noise level.
int32 * | pow_hist
| Histogram of frame power, moving window, decayed.
char * | frm_pow
| Frame power.
int32 | auto_thresh
| Do automatic threshold adjustment or not.
int32 | delta_sil
| Max silence power/frame ABOVE noise level.
int32 | delta_speech
| Min speech power/frame ABOVE noise level.
int32 | min_noise
| noise lower than this we ignore
int32 | max_noise
| noise higher than this signals an error
int32 | winsize
| how many frames to look at for speech det
int32 | speech_onset
| start speech on >= these many frames out of winsize, of >= delta_speech
int32 | sil_onset
| end speech on >= these many frames out of winsize, of <= delta_sil
int32 | leader
| pad beggining of speech with this many extra frms
int32 | trailer
| pad end of speech with this many extra frms
int32 | thresh_speech
| Frame considered to be speech if power >= thresh_speech (for transitioning from SILENCE to SPEECH state)
int32 | thresh_sil
| Frame considered to be silence if power <= thresh_sil (for transitioning from SPEECH to SILENCE state)
int32 | thresh_update
| Number of frames before next update to pow_hist/thresholds.
float32 | adapt_rate
| Linear interpolation constant for rate at which noise level adapted to each estimate; range: 0-1; 0=> no adaptation, 1=> instant adaptation.
int32 | tail_state
| State at the end of its internal buffer (internal use): CONT_AD_STATE_SIL or CONT_AD_STATE_SPEECH. More...
int32 | win_startfrm
| Where next analysis window begins.
int32 | win_validfrm
| Number of frames currently available from win_startfrm for analysis.
int32 | n_other
| If in SILENCE state, number of frames in analysis window considered to be speech; otherwise number of frames considered to be silence.
spseg_t * | spseg_head
| First of unconsumed speech segments.
spseg_t * | spseg_tail
| Last of unconsumed speech segments.
FILE * | rawfp
| If non-NULL, raw audio input data processed by cont_ad is dumped to this file. More...
FILE * | logfp
| If non-NULL, write detailed logs of this object's progress to the file. More...
int32 | n_calib_frame
| Number of frames of calibration data seen so far. More...

## Detailed Description

Continuous listening module or object Continuous listening module or object.

An application can open and maintain several such objects, if necessary. FYI: Module always in one of two states: SILENCE or SPEECH. Transitions between the two detected by sliding a window spanning several frames and looking for some minimum number of frames of the other type.

Definition at line 151 of file cont_ad.h.

## Field Documentation

ad_rec_t* cont_ad_t::ad

A/D device argument for adfunc.

Also, ad->sps used to determine frame size (spf, see below)

Definition at line 154 of file cont_ad.h.

Referenced by cont_ad_attach(), cont_ad_calib(), and cont_ad_detach().

FILE* cont_ad_t::logfp

If non-NULL, write detailed logs of this object's progress to the file.

Controlled by user application via cont_ad_set_logfp(). NULL when cont_ad object is initially created.

Definition at line 231 of file cont_ad.h.

Referenced by cont_ad_read(), and cont_ad_set_logfp().

int32 cont_ad_t::n_calib_frame

Number of frames of calibration data seen so far.

Definition at line 236 of file cont_ad.h.

Referenced by cont_ad_calib(), and cont_ad_calib_loop().

FILE* cont_ad_t::rawfp

If non-NULL, raw audio input data processed by cont_ad is dumped to this file.

Controlled by user application via cont_ad_set_rawfp(). NULL when cont_ad object is initially created.

Definition at line 227 of file cont_ad.h.

Referenced by cont_ad_set_rawfp().

int32 cont_ad_t::read_ts

Absolute timestamp (total no.

of raw samples consumed upto the most recent cont_ad_read call, starting from the very beginning). Note that this is a 32-bit integer; applications should guard against overflow.

Definition at line 167 of file cont_ad.h.

Referenced by cont_ad_read().

int32 cont_ad_t::seglen

Total no.

of raw samples consumed in the segment returned by the most recent cont_ad_read call. Can be used to detect silence segments that have stretched long enough to terminate an utterance

Definition at line 171 of file cont_ad.h.

Referenced by cont_ad_read().

int32 cont_ad_t::siglvl

Max signal level for the data consumed by the most recent cont_ad_read call (dB range: 0-99).

Can be used to update a V-U meter, for example.

Definition at line 175 of file cont_ad.h.

Referenced by cont_ad_read().

int32 cont_ad_t::sps

Samples/sec; moved from ad->sps to break dependence on ad by N.

Roy.

Definition at line 180 of file cont_ad.h.

Referenced by cont_ad_powhist_dump().

int32 cont_ad_t::state

State of data returned by most recent cont_ad_read call; CONT_AD_STATE_SIL or CONT_AD_STATE_SPEECH.

Definition at line 165 of file cont_ad.h.

Referenced by cont_ad_read().

int32 cont_ad_t::tail_state

State at the end of its internal buffer (internal use): CONT_AD_STATE_SIL or CONT_AD_STATE_SPEECH.

Note: This is different from cont_ad_t.state.

Definition at line 217 of file cont_ad.h.

Referenced by cont_ad_read(), cont_ad_reset(), and cont_set_thresh().

The documentation for this struct was generated from the following file:

- include/sphinxbase/cont_ad.h