julius/extern.h File Reference

External function declarations. More...

#include "search.h"

Include dependency graph for extern.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void bt_init (BACKTRELLIS *bt)
void bt_prepare (BACKTRELLIS *bt)
void bt_store (BACKTRELLIS *bt, TRELLIS_ATOM *aotm)
void bt_relocate_rw (BACKTRELLIS *bt)
void bt_discount_pescore (WCHMM_INFO *wchmm, BACKTRELLIS *bt, HTK_Param *param)
void bt_sort_rw (BACKTRELLIS *bt)
TRELLIS_ATOMbt_binsearch_atom (BACKTRELLIS *bt, int time, WORD_ID wkey)
void make_iwcache_index (WCHMM_INFO *wchmm)
void make_successor_list (WCHMM_INFO *wchmm)
boolean can_succeed (WCHMM_INFO *wchmm, WORD_ID lastword, int node)
void get_back_trellis_init (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis)
 Frame synchronous beam search: the fist frame.
boolean get_back_trellis_proceed (int t, HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis)
 Frame synchronous beam search: proceed for 2nd frame and later.
void get_back_trellis_end (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis)
 Frame synchronous beam search: last frame.
void get_back_trellis (HTK_Param *param, WCHMM_INFO *wchmm, BACKTRELLIS *backtrellis, LOGPROB *backmax)
 Frame synchronous beam search: the main.
LOGPROB finalize_1st_pass (BACKTRELLIS *backtrellis, WORD_INFO *winfo, int len)
 Finalize the 1st pass.
LOGPROB outprob_style (WCHMM_INFO *wchmm, int node, int last_wid, int t, HTK_Param *param)
void error_missing_right_triphone (HMM_Logical *base, char *rc_name)
void error_missing_left_triphone (HMM_Logical *base, char *lc_name)
int dfa_firstwords (NEXTWORD **nw, int peseqlen, int maxnw, DFA_INFO *dfa)
int dfa_nextwords (NODE *hypo, NEXTWORD **nw, int maxnw, DFA_INFO *dfa)
boolean dfa_acceptable (NODE *hypo, DFA_INFO *dfa)
boolean dfa_look_around (NEXTWORD *nword, NODE *hypo, BACKTRELLIS *bt)
void putsentence (NODE *hypo, int num)
void wchmm_fbs (HTK_Param *param, BACKTRELLIS *backtrellis, LOGPROB backmax, int stacksize, int ncan, int maxhypo, int cate_bgn, int cate_num)
void clear_stocker ()
void free_node (NODE *node)
NODEcpy_node (NODE *dst, NODE *src)
NODEnewnode ()
void malloc_wordtrellis ()
void free_wordtrellis ()
void scan_word (NODE *now, HTK_Param *param)
void next_word (NODE *now, NODE *new, NEXTWORD *nword, HTK_Param *param, BACKTRELLIS *backtrellis)
void start_word (NODE *new, NEXTWORD *nword, HTK_Param *param, BACKTRELLIS *backtrellis)
void last_next_word (NODE *now, NODE *new, HTK_Param *param)
HTK_Paramnew_wav2mfcc (SP16 speech[], int speechlen)
void put_header (FILE *stream)
void put_version (FILE *stream)
void put_compile_defs (FILE *stream)
void put_library_defs (FILE *stream)
WCHMM_INFOwchmm_new ()
void wchmm_free (WCHMM_INFO *w)
void print_wchmm_info (WCHMM_INFO *wchmm)
void build_wchmm2 (WCHMM_INFO *wchmm)
void wchmm_check_interactive (WCHMM_INFO *wchmm)
void check_wchmm (WCHMM_INFO *wchmm)
void RealTimeInit ()
void RealTimePipeLinePrepare ()
int RealTimePipeLine (SP16 *Speech, int len)
 Main function of on-the-fly 1st pass decoding.
int RealTimeResume ()
HTK_ParamRealTimeParam (LOGPROB *backmax)
void RealTimeCMNUpdate (HTK_Param *param)
void RealTimeTerminate ()
void word_align (WORD_ID *words, short wnum, HTK_Param *param)
void phoneme_align (WORD_ID *words, short wnum, HTK_Param *param)
void state_align (WORD_ID *words, short wnum, HTK_Param *param)
void word_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param)
void phoneme_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param)
void state_rev_align (WORD_ID *revwords, short wnum, HTK_Param *param)
void check_specs ()
 Check the user-specified parameters.
void print_setting ()
void print_info ()
int adin_cut_callback_store_buffer (SP16 *now, int len)
 adin_go() callback to score each detected speech segment to buffer.
void opt_terminate ()
void usage ()
void detailed_help ()
char * filepath (char *filename, char *dirname)
 Change relative path to full path.
void opt_parse (int argc, char *argv[], char *cwd)
void opt_release ()
void get_dirname (char *path)
 Get directory name from a path name of a file.
void config_file_parse (char *conffile)
void checkpath (char *filename)
int set_beam_width (WCHMM_INFO *wchmm, int specified)
 Determine beam width on the 1st pass.
void set_lm_weight ()
void set_lm_weight2 ()
void system_bootup ()
void adin_initialize ()
void final_fusion ()
 Read in all models and prepare data for recognition.
void setup_result_tty ()
void ttyout_status_recready ()
void ttyout_status_recstart ()
void ttyout_status_recend ()
void ttyout_status_param (HTK_Param *p)
void setup_result_msock ()
void decode_output_selection (char *str)
void msock_status_recready ()
void msock_status_recstart ()
void msock_status_recend ()
void msock_status_param (HTK_Param *p)
void hmm_check (HTK_HMM_INFO *hmminfo, WORD_INFO *winfo)
void record_sample_open ()
void record_sample_write (SP16 *speech, int samplenum)
void record_sample_close ()
void visual_init ()
void visual_show (BACKTRELLIS *bt)
void visual2_init (int maxhypo)
void visual2_popped (NODE *n, int popctr)
void visual2_next_word (NODE *next, NODE *prev, int popctr)
void visual2_best (NODE *now, WORD_INFO *winfo)
void gmm_init (HTK_HMM_INFO *gmm, int prune_num)
void gmm_prepare (HTK_HMM_INFO *gmm)
void gmm_proceed (HTK_HMM_INFO *gmm, HTK_Param *param, int t)
void gmm_end (HTK_HMM_INFO *gmm)
 Finish the GMM computation for an input, and output the result.
void msock_gmm ()
void ttyout_gmm ()
boolean gmm_valid_input ()
void main_recognition_loop ()
 Main recognition process loop.


Detailed Description

External function declarations.

Author:
Akinobu LEE
Date:
Mon Mar 7 23:19:14 2005
Revision
1.10

Definition in file extern.h.


Function Documentation

void bt_init ( BACKTRELLIS bt  ) 

Initialize backtrellis that will hold the whole word trellis (called once on startup).

Parameters:
bt [in] pointer to the backtrellis structure to initialize

Definition at line 74 of file backtrellis.c.

Referenced by final_fusion().

void bt_prepare ( BACKTRELLIS bt  ) 

Prepare backtrellis for the next input (called at beginning of each speech segment).

Parameters:
bt [in] pointer to the word trellis structure

Definition at line 96 of file backtrellis.c.

Referenced by get_back_trellis_init().

void bt_store ( BACKTRELLIS bt,
TRELLIS_ATOM tatom 
)

Store a trellis word generated on the 1st pass for the 2nd pass.

This function just store the new atom into backtrellis. They will be re-located per frame after 1st pass for quick access in the 2nd pass.

Parameters:
bt [i/o] backtrellis structure to store the trellis word
tatom [in] the trellis word to be stored

Definition at line 134 of file backtrellis.c.

Referenced by get_back_trellis_end().

void bt_relocate_rw ( BACKTRELLIS bt  ) 

Re-locate the stored atom lists per frame (will be called after the 1st pass).

Parameters:
bt [i/o] word trellis structure

Definition at line 161 of file backtrellis.c.

Referenced by finalize_1st_pass().

void bt_discount_pescore ( WCHMM_INFO wchmm,
BACKTRELLIS bt,
HTK_Param param 
)

Discount the output probabilities of the last state from the accumulated score on word edge for all trellis words survived on the 1st pass, for the acoustic re-computation on the 2nd pass. The acousitic likelihood of the word edge state will be re-computed when the next word hypotheses are expanded on the next 2nd pass.

Parameters:
wchmm [in] tree lexicon
bt [in] word trellis structure
param [in] input parameter

Definition at line 307 of file backtrellis.c.

Referenced by main_recognition_loop().

void bt_sort_rw ( BACKTRELLIS bt  ) 

Sort the trellis words in the backtrellis by the word IDs per each frame, for rapid access on the 2nd pass. This should be called just after bt_relocate_rw() was called.

Parameters:
bt [i/o] word trellis structure

Definition at line 382 of file backtrellis.c.

Referenced by finalize_1st_pass().

TRELLIS_ATOM* bt_binsearch_atom ( BACKTRELLIS bt,
int  t,
WORD_ID  wkey 
)

Search a word on the specified frame in a word trellis data.

Parameters:
bt [in] word trellis structure
t [in] word end frame on which to search
wkey [in] word ID to search
Returns:
pointer to the found trellis word, or NULL if not found.

Definition at line 420 of file backtrellis.c.

Referenced by start_word().

void get_back_trellis_init ( HTK_Param param,
WCHMM_INFO wchmm,
BACKTRELLIS backtrellis 
)

Frame synchronous beam search: the fist frame.

This function will initialize nodes, tokens and the resulting word trellis for the 1st pass, and then compute for the 1st frame by setting the initial hypotheses. For later frames other than the first one, get_back_trellis_proceed() should be called instead.

Parameters:
param [in] input vectors (onlyt the first frame will be used)
wchmm [in] tree lexicon
backtrellis [i/o] word trellis structure (will be initialized)

Definition at line 1477 of file beam.c.

Referenced by get_back_trellis(), RealTimeParam(), and RealTimePipeLine().

boolean get_back_trellis_proceed ( int  t,
HTK_Param param,
WCHMM_INFO wchmm,
BACKTRELLIS backtrellis 
)

Frame synchronous beam search: proceed for 2nd frame and later.

This is the main function of beam search on the 1st pass. Given a input vector of a frame, it proceeds the computation for the one frame, and store the words survived in the beam width to the word trellis structure. get_back_trellis_init() should be used for the first frame. For detailed procedure, please see the comments in this function.

Parameters:
t [in] current frame to be computed in param
param [in] input vector structure (only the vector at t will be used)
wchmm [in] tree lexicon
backtrellis [i/o] word trellis structure to hold the survived words on the t frame.
Returns:
TRUE if processing ended normally, or FALSE if the search was terminated (in case of short pause segmentation in successive decoding mode, or active nodes becomes zero).

Definition at line 1608 of file beam.c.

Referenced by get_back_trellis(), get_back_trellis_end(), RealTimeParam(), and RealTimePipeLine().

void get_back_trellis_end ( HTK_Param param,
WCHMM_INFO wchmm,
BACKTRELLIS backtrellis 
)

Frame synchronous beam search: last frame.

This function should be called at the end of the 1st pass. The last procedure will be done for the (param->samplenum - 1) frame.

Parameters:
param [in] input vectors (only param->samplenum is referred)
wchmm [in] tree lexicon
backtrellis [i/o] word trellis structure (the last survived words will be stored to this)

Definition at line 2363 of file beam.c.

Referenced by get_back_trellis(), RealTimeParam(), and RealTimeTerminate().

void get_back_trellis ( HTK_Param param,
WCHMM_INFO wchmm,
BACKTRELLIS backtrellis,
LOGPROB backmax 
)

Frame synchronous beam search: the main.

This function perform the 1st recognition pass of frame-synchronous beam search and output the result. It also stores all the word ends in every input frame to word trellis structure.

This function will be called if the whole input vector is already given to the end. When online recognition, where the 1st pass will be processed in parallel with input, this function will not be used. In that case, functions defined in this file will be directly called from functions in realtime-1stpass.c.

Parameters:
param [in] input vectors
wchmm [in] tree lexicon
backtrellis [out] pointer to structure in which the resulting word trellis data should be stored
backmax [out] the maximum score of the 1st pass, or LOG_ZERO if search failed.

Definition at line 2656 of file beam.c.

Referenced by main_recognition_loop().

LOGPROB finalize_1st_pass ( BACKTRELLIS backtrellis,
WORD_INFO winfo,
int  len 
)

Finalize the 1st pass.

This function will be called just after get_back_trellis_end() to finalize the 1st pass. It processes the resulting word trellis structure to be accessible from the 2nd pass, and output the best sentence hypothesis by backtracing the word trellis.

Parameters:
backtrellis [i/o] word trellis structure (will be reconstructed internally
winfo [in] word dictionary
len [in] total number of processed frames
Returns:
the maximum score of the best hypothesis, or LOG_ZERO if search failed.

Definition at line 2455 of file beam.c.

Referenced by get_back_trellis(), RealTimeParam(), and RealTimeTerminate().

LOGPROB outprob_style ( WCHMM_INFO wchmm,
int  node,
int  last_wid,
int  t,
HTK_Param param 
)

Calculate output log probability of an input vector on time frame t in input paramter param at a node on tree lexicon.

Parameters:
wchmm [in] tree lexicon structure
node [in] node ID to compute the output probability
last_wid [in] word ID of last word hypothesis (used when the node is within the word beginning phone and triphone is used.
t [in] time frame of input vector in param to compute.
param [in] input parameter structure
Returns:
the computed log probability.

Definition at line 354 of file outprob_style.c.

Referenced by bt_discount_pescore(), and init_nodescore().

void error_missing_right_triphone ( HMM_Logical base,
char *  rc_name 
)

Output error message when a triphone with the specified right context is not defined.

Parameters:
base [in] base triphone
rc_name [in] name of right context phone

Definition at line 513 of file outprob_style.c.

Referenced by lcdset_register_with_category(), next_word(), and scan_word().

void error_missing_left_triphone ( HMM_Logical base,
char *  lc_name 
)

Output error message when a triphone with the specified right context is not defined.

Parameters:
base [in] base triphone
lc_name [in] name of left context phone

Definition at line 538 of file outprob_style.c.

Referenced by outprob_style(), and scan_word().

int dfa_firstwords ( NEXTWORD **  nw,
int  peseqlen,
int  maxnw,
DFA_INFO dfa 
)

Return initial word set from grammar.

Parameters:
nw [out] pointer to hold the resulting next word set
peseqlen [in] input frame length
maxnw [in] maximum number of words that can be set in nw
dfa [in] DFA grammar structure
Returns:
the number of predicted words, or -1 on error.

Definition at line 86 of file dfa_decode.c.

Referenced by wchmm_fbs().

int dfa_nextwords ( NODE hypo,
NEXTWORD **  nw,
int  maxnw,
DFA_INFO dfa 
)

Given a part-of-sentence hypothesis, returns the next word set defined by DFA grammar.

Parameters:
hypo [in] the source part-of-sentene hypothesis
nw [out] pointer to hold the resulting next word set
maxnw [in] maximum number of words that can be set in nw
dfa [in] DFA grammar structure
Returns:
the number of predicted words, or -1 on error.

Definition at line 144 of file dfa_decode.c.

boolean dfa_acceptable ( NODE hypo,
DFA_INFO dfa 
)

Return whether the hypothesis is currently on final state

Parameters:
hypo [in] sentence hypothesis
dfa [in] DFA grammar structure
Returns:
TRUE when on final state, or FALSE if not acceptable.

Definition at line 201 of file dfa_decode.c.

boolean dfa_look_around ( NEXTWORD nword,
NODE hypo,
BACKTRELLIS bt 
)

Check if the given nextword exists in the word trellis around the estimated connection time. If exist, set the pointer to the corresponding trellis word to the nextword. Since the best connection time will be re-computed later, it need not to be an optimal one.

Parameters:
nword [i/o] next word candidate (pointer to the found trellis word will be set)
hypo [in] source part-of-sentence hypothesis
bt [in] word trellis structure
Returns:
TRUE if the nextword exists on the word trellis around the estimated connection point, or FALSE if not exist.

Definition at line 242 of file dfa_decode.c.

void wchmm_fbs ( HTK_Param param,
BACKTRELLIS backtrellis,
LOGPROB  backmax,
int  stacksize,
int  ncan,
int  maxhypo,
int  cate_bgn,
int  cate_num 
)

Main function to perform stack decoding of the 2nd search pass.

Parameters:
param [in] input parameter vector
backtrellis [in] backward word trellis obtained at the 1st pass
backmax [in] maximum score in the word trellis
stacksize [in] maximum size of hypothesis stack in the search
ncan [in] num of hypothesis to be found in the search
maxhypo [in] threshold num of hypothesis expansion to be treated as "search overflow"
cate_bgn [in] category id to allow word expansion from (ignored in Julius)
cate_num [in] num of category to allow word expansion from (ignored in Julius)

Definition at line 1083 of file search_bestfirst_main.c.

Referenced by main_recognition_loop().

void clear_stocker (  ) 

Clear the node stocker for recycle.

Definition at line 199 of file search_bestfirst_v1.c.

void free_node ( NODE node  ) 

Stock an unused hypothesis node for recycle.

Parameters:
node [in] hypothesis node

Definition at line 169 of file search_bestfirst_v1.c.

Referenced by free_all_nodes(), put_all_in_stack(), put_to_stack(), result_reorder_and_output(), and wchmm_fbs().

NODE* cpy_node ( NODE dst,
NODE src 
)

Copy the content of node to another.

Parameters:
dst [out] target hypothesis
src [in] source hypothesis
Returns:
the value of dst.

Definition at line 238 of file search_bestfirst_v1.c.

Referenced by last_next_word().

NODE* newnode (  ) 

Allocate a new hypothesis node. If the node stocker is not empty, the one in the stocker is re-used. Otherwise, allocate as new.

Returns:
pointer to the newly allocated node.

Definition at line 314 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void malloc_wordtrellis (  ) 

Allocate work area for trellis computation of a word.

Definition at line 418 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void free_wordtrellis (  ) 

Free the work area for trellis computation of a word.

Definition at line 456 of file search_bestfirst_v1.c.

void scan_word ( NODE now,
HTK_Param param 
)

Compute the forward viterbi for the last word to update forward scores and ready for word connection.

Parameters:
now [i/o] hypothesis
param [in] input parameter vectors

Definition at line 555 of file search_bestfirst_v1.c.

void next_word ( NODE now,
NODE new,
NEXTWORD nword,
HTK_Param param,
BACKTRELLIS backtrellis 
)

Connect a new word to generate a next hypothesis. The optimal connection point and new sentence score of the new hypothesis will be estimated by looking up the corresponding words on word trellis.

Parameters:
now [in] source hypothesis
new [out] pointer to save the newly generated hypothesis
nword [in] next word to be connected
param [in] input parameter vector
backtrellis [in] word trellis

Definition at line 1353 of file search_bestfirst_v1.c.

void start_word ( NODE new,
NEXTWORD nword,
HTK_Param param,
BACKTRELLIS backtrellis 
)

Generate an initial hypothesis from given word.

Parameters:
new [out] pointer to save the newly generated hypothesis
nword [in] words of the first candidates
param [in] input parameter vector
backtrellis [in] word trellis

Definition at line 1587 of file search_bestfirst_v1.c.

Referenced by wchmm_fbs().

void last_next_word ( NODE now,
NODE new,
HTK_Param param 
)

Hypothesis termination: set the final sentence scores of hypothesis that has already reached to the end.

Parameters:
now [in] hypothesis that has already reached to the end
new [out] pointer to save the final sentence information
param [in] input parameter vectors

Definition at line 1674 of file search_bestfirst_v1.c.

HTK_Param* new_wav2mfcc ( SP16  speech[],
int  speechlen 
)

Extract MFCC parameters with sentence CMN from given waveform.

Parameters:
speech [in] buffer of speech waveform
speechlen [in] length of speech in samples
Returns:
pointer to newly allocated parameter structure data with extracted MFCC vector sequence.

Definition at line 79 of file wav2mfcc.c.

Referenced by main_recognition_loop().

void put_header ( FILE *  strm  ) 

Output application header.

Parameters:
strm [in] output stream

Definition at line 48 of file version.c.

Referenced by detailed_help(), opt_parse(), print_info(), and put_header().

void put_version ( FILE *  strm  ) 

Output version information.

Parameters:
strm [in] output stream

Definition at line 65 of file version.c.

Referenced by put_version(), and usage().

void put_compile_defs ( FILE *  strm  ) 

Output compile-time settings.

Parameters:
strm [in] input stream

Definition at line 89 of file version.c.

Referenced by detailed_help(), opt_parse(), print_info(), and put_compile_defs().

void put_library_defs ( FILE *  strm  ) 

Output library configuration.

Parameters:
strm [in] output stream

Definition at line 255 of file version.c.

Referenced by opt_parse(), and put_library_defs().

WCHMM_INFO* wchmm_new (  ) 

Allocate a new tree lexicon structure.

Returns:
pointer to the newly allocated tree lexicon structure.

Definition at line 70 of file wchmm.c.

Referenced by final_fusion(), and multigram_setup().

void wchmm_free ( WCHMM_INFO w  ) 

Free all data in a tree lexicon.

Parameters:
w [in] tree lexicon

Definition at line 206 of file wchmm.c.

Referenced by multigram_setup().

void print_wchmm_info ( WCHMM_INFO wchmm  ) 

Output some specifications of the tree lexicon (size etc.) to stdout.

Parameters:
wchmm [in] tree lexicon already built

Definition at line 1958 of file wchmm.c.

Referenced by print_info().

void build_wchmm2 ( WCHMM_INFO wchmm  ) 

Build a tree lexicon from given word dictionary and language model. This function does the same job as build_wchmm(), but it is much faster because finding of the longest matched word to an adding word is done by first sorting all the words in the dictoinary by their phoneme sequence order. This function will be used instead of build_wchmm() by default.

Parameters:
wchmm [i/o] lexicon tree

Definition at line 1682 of file wchmm.c.

Referenced by final_fusion(), and multigram_setup().

void wchmm_check_interactive ( WCHMM_INFO wchmm  ) 

Command loop to browse and check the structure of the constructed tree lexicon on startup.

Parameters:
wchmm [in] tree lexicon

Definition at line 313 of file wchmm_check.c.

void check_wchmm ( WCHMM_INFO wchmm  ) 

Check coherence of tree lexicon (for internal debug only!)

Parameters:
wchmm [in] tree lexicon

Definition at line 424 of file wchmm_check.c.

void RealTimeInit (  ) 

Initializations for on-the-fly 1st pass decoding (will be called once on startup)

Definition at line 207 of file realtime-1stpass.c.

Referenced by final_fusion().

void RealTimePipeLinePrepare (  ) 

Data preparation for on-the-fly 1st pass decoding (will be called on the start of each sentence input)

Definition at line 266 of file realtime-1stpass.c.

Referenced by main_recognition_loop().

int RealTimePipeLine ( SP16 Speech,
int  nowlen 
)

Main function of on-the-fly 1st pass decoding.

This function will be called each time a new speech sample comes, as as callback from A/D-in routine. When a speech input begins, the captured speech will be passed to this function for every sample segments. This process will continue until A/D-in routine detects an end of speech or input stream reached to an end.

This function will perform feture vector extraction and beam decording as 1st pass recognition simultaneously, in frame-wise mannar.

Parameters:
Speech [in] pointer to the speech sample segments
nowlen [in] length of above
Returns:
-1 on error (tell caller to terminate), 0 on success (allow caller to call me for the next segment), or 1 when an input segmentation is required at this point (in that case caller will stop input and go to 2nd pass)

Definition at line 351 of file realtime-1stpass.c.

Referenced by main_recognition_loop().

HTK_Param* RealTimeParam ( LOGPROB backmax  ) 

Finalize the 1st pass on-the-fly decoding.

Parameters:
backmax [out] pointer to store the maximum score of last frame.
Returns:
newly allocated input parameter data for this input.

Definition at line 712 of file realtime-1stpass.c.

Referenced by main_recognition_loop().

void RealTimeCMNUpdate ( HTK_Param param  ) 

Update cepstral mean of CMN to prepare for the next input.

Parameters:
param [in] current input parameter

Definition at line 862 of file realtime-1stpass.c.

Referenced by main_recognition_loop().

void RealTimeTerminate (  ) 

Finalize the 1st pass on-the-fly decoding when terminated.

Definition at line 910 of file realtime-1stpass.c.

Referenced by main_recognition_loop().

void word_align ( WORD_ID words,
short  wnum,
HTK_Param param 
)

Do forced alignment per word for the given word sequence.

Parameters:
words [in] word sequence
wnum [in] length of words
param [in] input parameter vectors

Definition at line 381 of file word_align.c.

void phoneme_align ( WORD_ID words,
short  num,
HTK_Param param 
)

Do forced alignment per phoneme for the given word sequence.

Parameters:
words [in] word sequence
num [in] length of words
param [in] input parameter vectors

Definition at line 430 of file word_align.c.

void state_align ( WORD_ID words,
short  num,
HTK_Param param 
)

Do forced alignment per HMM state for the given word sequence.

Parameters:
words [in] word sequence
num [in] length of words
param [in] input parameter vectors

Definition at line 479 of file word_align.c.

void word_rev_align ( WORD_ID revwords,
short  wnum,
HTK_Param param 
)

Do forced alignment per word for the given word sequence (reversed order).

Parameters:
revwords [in] word sequence in reversed direction
wnum [in] length of revwords
param [in] input parameter vectors

Definition at line 403 of file word_align.c.

Referenced by result_reorder_and_output().

void phoneme_rev_align ( WORD_ID revwords,
short  num,
HTK_Param param 
)

Do forced alignment per phoneme for the given word sequence (reversed order).

Parameters:
revwords [in] word sequence in reversed direction
num [in] length of revwords
param [in] input parameter vectors

Definition at line 452 of file word_align.c.

Referenced by result_reorder_and_output().

void state_rev_align ( WORD_ID revwords,
short  num,
HTK_Param param 
)

Do forced alignment per state for the given word sequence (reversed order).

Parameters:
revwords [in] word sequence in reversed direction
num [in] length of revwords
param [in] input parameter vectors

Definition at line 501 of file word_align.c.

Referenced by result_reorder_and_output().

void check_specs (  ) 

Check the user-specified parameters.

This functions checks whether the specified files actually exist, and also the mutual coherence of the parameters and their correspondence with used model is also checked. If a serious error is found, it produces error and exits.

Definition at line 87 of file m_chkparam.c.

Referenced by main().

void print_setting (  ) 

Output all file names of the models.

Definition at line 37 of file m_info.c.

Referenced by print_info().

void print_info (  ) 

Output full system information.

Definition at line 88 of file m_info.c.

Referenced by main_recognition_loop().

int adin_cut_callback_store_buffer ( SP16 now,
int  len 
)

adin_go() callback to score each detected speech segment to buffer.

This function records the incomping speech segments detected in adin_go() to a buffer speech. This function will be used when recognition runs in buffered mode (= non-realtime mode).

Parameters:
now [in] input speech samples.
len [in] length of now in samples
Returns:
-1 on error (tell adin_go() to terminate), 0 on success (tell adin_go() to continue recording), or 1 when this function requires input segmentation.

Definition at line 103 of file main.c.

Referenced by main_recognition_loop(), and RealTimePipeLine().

void opt_terminate (  ) 

Output error message and error exit (for option parse error)

Definition at line 37 of file m_usage.c.

Referenced by args_needed_exit(), and opt_parse().

void usage (  ) 

Output version messages and exit (for exec with no option)

Definition at line 53 of file m_usage.c.

Referenced by opt_parse().

void detailed_help (  ) 

Output version info, engine setting and detailed help for options, and exit.

Definition at line 72 of file m_usage.c.

Referenced by opt_parse().

char* filepath ( char *  filename,
char *  dirname 
)

Change relative path to full path.

If the file path is given as relative, prepend the dirname to it. If the file path is full, just copy it to new buffer and return.

Parameters:
filename [in] file path name
dirname [in] full path of current directory
Returns:
newly malloced buffer holding the full path name.

Definition at line 51 of file m_options.c.

Referenced by multigram_add_prefix_filelist(), multigram_add_prefix_list(), and opt_parse().

void opt_parse ( int  argc,
char *  argv[],
char *  cwd 
)

Parse options and set values.

Parameters:
argc [in] number of elements in argv
argv [in] array of argument strings
cwd [in] current directory string

Definition at line 109 of file m_options.c.

Referenced by config_file_parse(), and main().

void opt_release (  ) 

Free memories of global variables allocated by option arguments.

Definition at line 835 of file m_options.c.

Referenced by m_errexit(), m_exit(), and main().

void get_dirname ( char *  path  ) 

Get directory name from a path name of a file.

The trailing slash will be left, and the given buffer will be modified.

Parameters:
path [i/o] file path name, will be modified to directory name

Definition at line 127 of file m_jconf.c.

Referenced by config_file_parse(), and multigram_add_prefix_filelist().

void config_file_parse ( char *  conffile  ) 

Read and parse a jconf file, and set the specified option values.

Parameters:
conffile [in] jconf file path name

Definition at line 159 of file m_jconf.c.

Referenced by opt_parse().

void checkpath ( char *  filename  ) 

Check if a file actually exist and is readable.

Parameters:
filename [in] file path name

Definition at line 39 of file m_chkparam.c.

Referenced by check_specs(), multigram_add_prefix_filelist(), and multigram_add_prefix_list().

int set_beam_width ( WCHMM_INFO wchmm,
int  specified 
)

Determine beam width on the 1st pass.

Parameters:
wchmm [in] tree lexicon data
specified [in] user-specified beam width (0: full search, -1: not specified)
Returns:
the final beam width to be used.

Definition at line 283 of file m_chkparam.c.

Referenced by final_fusion(), and multigram_setup().

void system_bootup (  ) 

Function to be called at the first stage on system bootup. It will setup memory allocation functions and register error handling functions.

Definition at line 103 of file m_bootup.c.

Referenced by main().

void adin_initialize (  ) 

Initialize audio input device specified by speech_input, and set parameters for sampling rate and speech detection parameters.

Definition at line 39 of file m_adin.c.

Referenced by main_recognition_loop().

void final_fusion (  ) 

Read in all models and prepare data for recognition.

This function reads in all the models needed for recognition, inspects the models and their relations, builds a tree lexicon, and allocate cache. Some default parameters will also be set here.

Definition at line 331 of file m_fusion.c.

Referenced by main_recognition_loop().

void setup_result_tty (  ) 

Register output functions to enable module output.

Definition at line 650 of file result_tty.c.

Referenced by select_result_output().

void ttyout_status_recready (  ) 

Output when ready to recognize and start waiting speech input.

Definition at line 579 of file result_tty.c.

Referenced by setup_result_tty().

void ttyout_status_recstart (  ) 

Output when input starts.

Definition at line 597 of file result_tty.c.

Referenced by setup_result_tty().

void ttyout_status_recend (  ) 

Output when input ends.

Definition at line 612 of file result_tty.c.

Referenced by setup_result_tty().

void ttyout_status_param ( HTK_Param param  ) 

Output input parameter status such as length.

Parameters:
param [in] input parameter structure

Definition at line 629 of file result_tty.c.

Referenced by setup_result_tty().

void setup_result_msock (  ) 

Register output functions to enable module output.

Definition at line 586 of file result_msock.c.

Referenced by select_result_output().

void decode_output_selection ( char *  str  ) 

Setup which word information to be output as a recognition result.

Parameters:
str [in] output selection string (part of "WLPSCwlps")

Definition at line 84 of file result_msock.c.

Referenced by opt_parse().

void msock_status_recready (  ) 

Output when ready to recognize and start waiting speech input.

Definition at line 520 of file result_msock.c.

Referenced by setup_result_msock().

void msock_status_recstart (  ) 

Output when input starts.

Definition at line 535 of file result_msock.c.

Referenced by setup_result_msock().

void msock_status_recend (  ) 

Output when input ends.

Definition at line 550 of file result_msock.c.

Referenced by setup_result_msock().

void msock_status_param ( HTK_Param param  ) 

Output input parameter status such as length.

Parameters:
param [in] input parameter structure

Definition at line 567 of file result_msock.c.

Referenced by setup_result_msock().

void hmm_check ( HTK_HMM_INFO hmminfo,
WORD_INFO winfo 
)

Mode to do interactive triphone conversion check ("-check triphone").

Parameters:
hmminfo [in] HMM definition structure
winfo [in] word dictionary

Definition at line 294 of file hmm_check.c.

Referenced by initialize_dict(), and multigram_read_file().

void record_sample_open (  ) 

Open temporary file for starting recording.

Definition at line 146 of file record.c.

Referenced by main_recognition_loop(), and RealTimePipeLinePrepare().

void record_sample_write ( SP16 speech,
int  samplenum 
)

Append speech segment to file previously opened by record_sample_open().

Parameters:
speech [in] speech buffer
samplenum [in] length of above in samples

Definition at line 175 of file record.c.

Referenced by adin_cut_callback_store_buffer(), and RealTimePipeLine().

void record_sample_close (  ) 

End recording. Close the current temporary recording file, and rename the temporary file to the final time-stamp file name.

Definition at line 207 of file record.c.

Referenced by main_recognition_loop().

void gmm_init ( HTK_HMM_INFO gmm,
int  gmm_prune_num 
)

Initialization for computing GMM likelihoods. This will be called once on startup.

Parameters:
gmm [in] GMM definition structure
gmm_prune_num [in] number of Gaussians which is guaranteed to be fully computed on Gaussian pruning

Definition at line 397 of file gmm.c.

Referenced by initialize_GMM().

void gmm_prepare ( HTK_HMM_INFO gmm  ) 

Prepare for the next GMM computation. This will be called just before an input begins.

Parameters:
gmm [in] GMM definition structure

Definition at line 444 of file gmm.c.

Referenced by get_back_trellis_init().

void gmm_proceed ( HTK_HMM_INFO gmm,
HTK_Param param,
int  t 
)

Compute output probabilities of all GMM for a given input vector, and accumulate the results to the gmm_score buffer.

Parameters:
gmm [in] GMM definition structure
param [in] input vectors
t [in] time frame to compute the probabilities.

Definition at line 477 of file gmm.c.

void gmm_end ( HTK_HMM_INFO gmm  ) 

Finish the GMM computation for an input, and output the result.

The GMM of the maximum score is finally determined from the accumulated scores computed by gmm_proceed(), and compute the confidence score of the maximum GMM using posterior probability. Then the result will be output using result_gmm().

Parameters:
gmm [in] GMM definition structure.

Definition at line 520 of file gmm.c.

Referenced by finalize_1st_pass().

void msock_gmm (  ) 

Send the result of GMM computation to module client. (for "-result msock" option)

Definition at line 630 of file gmm.c.

Referenced by setup_result_msock().

void ttyout_gmm (  ) 

Output result of GMM computation to standard out. (for "-result tty" option)

Definition at line 592 of file gmm.c.

Referenced by setup_result_tty().

boolean gmm_valid_input (  ) 

Return whether the last input was valid or invalid, from the result of GMM computation.

Returns:
TRUE if input is valid, i.e. the name of maximum GMM is not included in gmm_reject_cmn_string, or FALSE if input is invalid, i.e. the name is included in that string.

Definition at line 570 of file gmm.c.

Referenced by main_recognition_loop(), and RealTimeCMNUpdate().

void main_recognition_loop (  ) 

Main recognition process loop.

This function is a main loop to execute recognition. First the whole recognition system is setup, and then it enters a main event loop. If the start of speech input is detected, the recognition process of the first pass and second pass will be performed in turn, and the result will be output, and return to the event loop. In module mode, the module commands from module client will also be received and processed here.

Main Recognition Loop

Definition at line 253 of file main.c.

Referenced by main(), and main_module_loop().


Generated on Tue Dec 26 12:53:29 2006 for Julian by  doxygen 1.5.0