PocketSphinx
0.6
|
Main header file for the PocketSphinx decoder. More...
#include <stdio.h>
#include <sphinxbase/cmd_ln.h>
#include <sphinxbase/logmath.h>
#include <sphinxbase/fe.h>
#include <sphinxbase/feat.h>
#include <sphinxbase/ngram_model.h>
#include <pocketsphinx_export.h>
#include <cmdln_macro.h>
#include <ps_lattice.h>
#include <ps_mllr.h>
#include <fsg_set.h>
Go to the source code of this file.
Typedefs | |
typedef struct ps_decoder_s | ps_decoder_t |
PocketSphinx speech recognizer object. | |
typedef struct ps_astar_s | ps_nbest_t |
PocketSphinx N-best hypothesis iterator object. | |
typedef struct ps_seg_s | ps_seg_t |
PocketSphinx segmentation iterator object. | |
Functions | |
POCKETSPHINX_EXPORT ps_decoder_t * | ps_init (cmd_ln_t *config) |
Initialize the decoder from a configuration object. More... | |
POCKETSPHINX_EXPORT int | ps_reinit (ps_decoder_t *ps, cmd_ln_t *config) |
Reinitialize the decoder with updated configuration. More... | |
POCKETSPHINX_EXPORT arg_t const * | ps_args (void) |
Returns the argument definitions used in ps_init(). More... | |
POCKETSPHINX_EXPORT ps_decoder_t * | ps_retain (ps_decoder_t *ps) |
Retain a pointer to the decoder. More... | |
POCKETSPHINX_EXPORT int | ps_free (ps_decoder_t *ps) |
Finalize the decoder. More... | |
POCKETSPHINX_EXPORT cmd_ln_t * | ps_get_config (ps_decoder_t *ps) |
Get the configuration object for this decoder. More... | |
POCKETSPHINX_EXPORT logmath_t * | ps_get_logmath (ps_decoder_t *ps) |
Get the log-math computation object for this decoder. More... | |
POCKETSPHINX_EXPORT fe_t * | ps_get_fe (ps_decoder_t *ps) |
Get the feature extraction object for this decoder. More... | |
POCKETSPHINX_EXPORT feat_t * | ps_get_feat (ps_decoder_t *ps) |
Get the dynamic feature computation object for this decoder. More... | |
POCKETSPHINX_EXPORT ps_mllr_t * | ps_update_mllr (ps_decoder_t *ps, ps_mllr_t *mllr) |
Adapt current acoustic model using a linear transform. More... | |
POCKETSPHINX_EXPORT ngram_model_t * | ps_get_lmset (ps_decoder_t *ps) |
Get the language model set object for this decoder. More... | |
POCKETSPHINX_EXPORT ngram_model_t * | ps_update_lmset (ps_decoder_t *ps, ngram_model_t *lmset) |
Update the language model set object for this decoder. More... | |
POCKETSPHINX_EXPORT fsg_set_t * | ps_get_fsgset (ps_decoder_t *ps) |
Get the finite-state grammar set object for this decoder. More... | |
POCKETSPHINX_EXPORT fsg_set_t * | ps_update_fsgset (ps_decoder_t *ps) |
Update the finite-state grammar set object for this decoder. More... | |
POCKETSPHINX_EXPORT int | ps_load_dict (ps_decoder_t *ps, char const *dictfile, char const *fdictfile, char const *format) |
Reload the pronunciation dictionary from a file. More... | |
POCKETSPHINX_EXPORT int | ps_save_dict (ps_decoder_t *ps, char const *dictfile, char const *format) |
Dump the current pronunciation dictionary to a file. More... | |
POCKETSPHINX_EXPORT int | ps_add_word (ps_decoder_t *ps, char const *word, char const *phones, int update) |
Add a word to the pronunciation dictionary. More... | |
POCKETSPHINX_EXPORT int | ps_decode_raw (ps_decoder_t *ps, FILE *rawfh, char const *uttid, long maxsamps) |
Decode a raw audio stream. More... | |
POCKETSPHINX_EXPORT int | ps_decode_senscr (ps_decoder_t *ps, FILE *senfh, char const *uttid) |
Decode a senone score dump file. More... | |
POCKETSPHINX_EXPORT int | ps_start_utt (ps_decoder_t *ps, char const *uttid) |
Start utterance processing. More... | |
POCKETSPHINX_EXPORT char const * | ps_get_uttid (ps_decoder_t *ps) |
Get current utterance ID. More... | |
POCKETSPHINX_EXPORT int | ps_process_raw (ps_decoder_t *ps, int16 const *data, size_t n_samples, int no_search, int full_utt) |
Decode raw audio data. More... | |
POCKETSPHINX_EXPORT int | ps_process_cep (ps_decoder_t *ps, mfcc_t **data, int n_frames, int no_search, int full_utt) |
Decode acoustic feature data. More... | |
POCKETSPHINX_EXPORT int | ps_get_n_frames (ps_decoder_t *ps) |
Get the number of frames of data searched. More... | |
POCKETSPHINX_EXPORT int | ps_end_utt (ps_decoder_t *ps) |
End utterance processing. More... | |
POCKETSPHINX_EXPORT char const * | ps_get_hyp (ps_decoder_t *ps, int32 *out_best_score, char const **out_uttid) |
Get hypothesis string and path score. More... | |
POCKETSPHINX_EXPORT char const * | ps_get_hyp_final (ps_decoder_t *ps, int32 *out_is_final) |
Get hypothesis string and final flag. More... | |
POCKETSPHINX_EXPORT int32 | ps_get_prob (ps_decoder_t *ps, char const **out_uttid) |
Get posterior probability. More... | |
POCKETSPHINX_EXPORT ps_lattice_t * | ps_get_lattice (ps_decoder_t *ps) |
Get word lattice. More... | |
POCKETSPHINX_EXPORT ps_seg_t * | ps_seg_iter (ps_decoder_t *ps, int32 *out_best_score) |
Get an iterator over the word segmentation for the best hypothesis. More... | |
POCKETSPHINX_EXPORT ps_seg_t * | ps_seg_next (ps_seg_t *seg) |
Get the next segment in a word segmentation. More... | |
POCKETSPHINX_EXPORT char const * | ps_seg_word (ps_seg_t *seg) |
Get word string from a segmentation iterator. More... | |
POCKETSPHINX_EXPORT void | ps_seg_frames (ps_seg_t *seg, int *out_sf, int *out_ef) |
Get inclusive start and end frames from a segmentation iterator. More... | |
POCKETSPHINX_EXPORT int32 | ps_seg_prob (ps_seg_t *seg, int32 *out_ascr, int32 *out_lscr, int32 *out_lback) |
Get language, acoustic, and posterior probabilities from a segmentation iterator. More... | |
POCKETSPHINX_EXPORT void | ps_seg_free (ps_seg_t *seg) |
Finish iterating over a word segmentation early, freeing resources. | |
POCKETSPHINX_EXPORT ps_nbest_t * | ps_nbest (ps_decoder_t *ps, int sf, int ef, char const *ctx1, char const *ctx2) |
Get an iterator over the best hypotheses, optionally within a selected region of the utterance. More... | |
POCKETSPHINX_EXPORT ps_nbest_t * | ps_nbest_next (ps_nbest_t *nbest) |
Move an N-best list iterator forward. More... | |
POCKETSPHINX_EXPORT char const * | ps_nbest_hyp (ps_nbest_t *nbest, int32 *out_score) |
Get the hypothesis string from an N-best list iterator. More... | |
POCKETSPHINX_EXPORT ps_seg_t * | ps_nbest_seg (ps_nbest_t *nbest, int32 *out_score) |
Get the word segmentation from an N-best list iterator. More... | |
POCKETSPHINX_EXPORT void | ps_nbest_free (ps_nbest_t *nbest) |
Finish N-best search early, releasing resources. More... | |
POCKETSPHINX_EXPORT void | ps_get_utt_time (ps_decoder_t *ps, double *out_nspeech, double *out_ncpu, double *out_nwall) |
Get performance information for the current utterance. More... | |
POCKETSPHINX_EXPORT void | ps_get_all_time (ps_decoder_t *ps, double *out_nspeech, double *out_ncpu, double *out_nwall) |
Get overall performance information. More... | |
Main header file for the PocketSphinx decoder.
Definition in file pocketsphinx.h.
POCKETSPHINX_EXPORT int ps_add_word | ( | ps_decoder_t * | ps, |
char const * | word, | ||
char const * | phones, | ||
int | update | ||
) |
Add a word to the pronunciation dictionary.
This function adds a word to the pronunciation dictionary and the current language model (but, obviously, not to the current FSG if FSG mode is enabled). If the word is already present in one or the other, it does whatever is necessary to ensure that the word can be recognized.
word | Word string to add. |
phones | Whitespace-separated list of phoneme strings describing pronunciation of word . |
update | If TRUE, update the search module (whichever one is currently active) to recognize the newly added word. If adding multiple words, it is more efficient to pass FALSE here in all but the last word. |
Definition at line 519 of file pocketsphinx.c.
References ps_decoder_s::acmod, bin_mdef_ciphone_id(), ps_decoder_s::d2p, ps_decoder_s::dict, dict2pid_add_word(), dict_add_word(), acmod_s::mdef, and ps_get_lmset().
POCKETSPHINX_EXPORT arg_t const* ps_args | ( | void | ) |
Returns the argument definitions used in ps_init().
This is here to avoid exporting global data, which is problematic on Win32 and Symbian (and possibly other platforms).
Definition at line 313 of file pocketsphinx.c.
Referenced by ps_load_dict().
POCKETSPHINX_EXPORT int ps_decode_raw | ( | ps_decoder_t * | ps, |
FILE * | rawfh, | ||
char const * | uttid, | ||
long | maxsamps | ||
) |
Decode a raw audio stream.
No headers are recognized in this files. The configuration parameters -samprate
and -input_endian
are used to determine the sampling rate and endianness of the stream, respectively. Audio is always assumed to be 16-bit signed PCM.
ps | Decoder. |
rawfh | Previously opened file stream. |
uttid | Utterance ID (or NULL to generate automatically). |
maxsamps | Maximum number of samples to read from rawfh, or -1 to read until end-of-file. |
Definition at line 580 of file pocketsphinx.c.
References ps_process_raw(), and ps_start_utt().
POCKETSPHINX_EXPORT int ps_decode_senscr | ( | ps_decoder_t * | ps, |
FILE * | senfh, | ||
char const * | uttid | ||
) |
Decode a senone score dump file.
ps | Decoder |
senfh | Previously opened file handle positioned at start of file. |
uttid | Utterance ID (or NULL to generate automatically). |
Definition at line 727 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_read_scores(), acmod_set_insenfh(), ps_end_utt(), and ps_start_utt().
POCKETSPHINX_EXPORT int ps_end_utt | ( | ps_decoder_t * | ps | ) |
End utterance processing.
ps | Decoder. |
Definition at line 816 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_end_utt(), ps_decoder_s::perf, and ps_decoder_s::phone_loop.
Referenced by ps_decode_senscr().
POCKETSPHINX_EXPORT int ps_free | ( | ps_decoder_t * | ps | ) |
Finalize the decoder.
This releases all resources associated with the decoder, including any language models or grammars which have been added to it, and the initial configuration object passed to ps_init().
ps | Decoder to be freed. |
Definition at line 326 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_free(), ps_decoder_s::config, ps_decoder_s::d2p, ps_decoder_s::dict, dict2pid_free(), dict_free(), ps_decoder_s::lmath, ps_decoder_s::refcount, and ps_decoder_s::uttid.
Referenced by ps_init().
POCKETSPHINX_EXPORT void ps_get_all_time | ( | ps_decoder_t * | ps, |
double * | out_nspeech, | ||
double * | out_ncpu, | ||
double * | out_nwall | ||
) |
Get overall performance information.
ps | Decoder. |
out_nspeech | Output: Number of seconds of speech. |
out_ncpu | Output: Number of seconds of CPU time used. |
out_nwall | Output: Number of seconds of wall time used. |
Definition at line 1052 of file pocketsphinx.c.
References ps_decoder_s::config, ps_decoder_s::n_frame, and ps_decoder_s::perf.
POCKETSPHINX_EXPORT cmd_ln_t* ps_get_config | ( | ps_decoder_t * | ps | ) |
Get the configuration object for this decoder.
Definition at line 350 of file pocketsphinx.c.
References ps_decoder_s::config.
POCKETSPHINX_EXPORT fe_t* ps_get_fe | ( | ps_decoder_t * | ps | ) |
Get the feature extraction object for this decoder.
Definition at line 362 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::fe.
POCKETSPHINX_EXPORT feat_t* ps_get_feat | ( | ps_decoder_t * | ps | ) |
Get the dynamic feature computation object for this decoder.
Definition at line 368 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::fcb.
POCKETSPHINX_EXPORT fsg_set_t* ps_get_fsgset | ( | ps_decoder_t * | ps | ) |
Get the finite-state grammar set object for this decoder.
If FSG decoding is not enabled, this returns NULL. Call ps_update_fsgset() to enable it.
Definition at line 423 of file pocketsphinx.c.
References ps_decoder_s::search.
POCKETSPHINX_EXPORT char const* ps_get_hyp | ( | ps_decoder_t * | ps, |
int32 * | out_best_score, | ||
char const ** | out_uttid | ||
) |
Get hypothesis string and path score.
ps | Decoder. |
out_best_score | Output: path score corresponding to returned string. |
out_uttid | Output: utterance ID for this utterance. |
Definition at line 872 of file pocketsphinx.c.
References ps_decoder_s::perf.
POCKETSPHINX_EXPORT char const* ps_get_hyp_final | ( | ps_decoder_t * | ps, |
int32 * | out_is_final | ||
) |
Get hypothesis string and final flag.
ps | Decoder. |
out_is_final | Output: if hypothesis is reached final state in the grammar. |
Definition at line 885 of file pocketsphinx.c.
References ps_decoder_s::perf.
POCKETSPHINX_EXPORT ps_lattice_t* ps_get_lattice | ( | ps_decoder_t * | ps | ) |
Get word lattice.
There isn't much you can do with this so far, a public API will appear in the future.
ps | Decoder. |
Definition at line 955 of file pocketsphinx.c.
Referenced by ps_nbest().
POCKETSPHINX_EXPORT ngram_model_t* ps_get_lmset | ( | ps_decoder_t * | ps | ) |
Get the language model set object for this decoder.
If N-Gram decoding is not enabled, this will return NULL. You will need to enable it using ps_update_lmset().
Definition at line 380 of file pocketsphinx.c.
References ps_decoder_s::search.
Referenced by ps_add_word().
POCKETSPHINX_EXPORT logmath_t* ps_get_logmath | ( | ps_decoder_t * | ps | ) |
Get the log-math computation object for this decoder.
Definition at line 356 of file pocketsphinx.c.
References ps_decoder_s::lmath.
POCKETSPHINX_EXPORT int ps_get_n_frames | ( | ps_decoder_t * | ps | ) |
Get the number of frames of data searched.
Note that there is a delay between this and the number of frames of audio which have been input to the system. This is due to the fact that acoustic features are computed using a sliding window of audio, and dynamic features are computed over a sliding window of acoustic features.
ps | Decoder. |
Definition at line 1034 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::output_frame.
POCKETSPHINX_EXPORT int32 ps_get_prob | ( | ps_decoder_t * | ps, |
char const ** | out_uttid | ||
) |
Get posterior probability.
ps | Decoder. |
out_uttid | Output: utterance ID for this utterance. |
Definition at line 897 of file pocketsphinx.c.
References ps_decoder_s::perf.
POCKETSPHINX_EXPORT void ps_get_utt_time | ( | ps_decoder_t * | ps, |
double * | out_nspeech, | ||
double * | out_ncpu, | ||
double * | out_nwall | ||
) |
Get performance information for the current utterance.
ps | Decoder. |
out_nspeech | Output: Number of seconds of speech. |
out_ncpu | Output: Number of seconds of CPU time used. |
out_nwall | Output: Number of seconds of wall time used. |
Definition at line 1040 of file pocketsphinx.c.
References ps_decoder_s::acmod, ps_decoder_s::config, acmod_s::output_frame, and ps_decoder_s::perf.
POCKETSPHINX_EXPORT char const* ps_get_uttid | ( | ps_decoder_t * | ps | ) |
Get current utterance ID.
ps | Decoder to query. |
Definition at line 344 of file pocketsphinx.c.
References ps_decoder_s::uttid.
POCKETSPHINX_EXPORT ps_decoder_t* ps_init | ( | cmd_ln_t * | config | ) |
Initialize the decoder from a configuration object.
config
, so you must not attempt to free it manually. If you wish to reuse it elsewhere, call cmd_ln_retain() on it.config | a command-line structure, as created by cmd_ln_parse_r() or cmd_ln_parse_file_r(). |
Definition at line 299 of file pocketsphinx.c.
References ps_free(), ps_reinit(), and ps_decoder_s::refcount.
POCKETSPHINX_EXPORT int ps_load_dict | ( | ps_decoder_t * | ps, |
char const * | dictfile, | ||
char const * | fdictfile, | ||
char const * | format | ||
) |
Reload the pronunciation dictionary from a file.
This function replaces the current pronunciation dictionary with the one stored in dictfile. This also causes the active search module(s) to be reinitialized, in the same manner as calling ps_add_word() with update=TRUE.
dictfile | Path to dictionary file to load. |
fdictfile | Path to filler dictionary to load, or NULL to keep the existing filler dictionary. |
format | Format of the dictionary file, or NULL to determine automatically (currently unused,should be NULL) |
Definition at line 457 of file pocketsphinx.c.
References ps_args().
POCKETSPHINX_EXPORT ps_nbest_t* ps_nbest | ( | ps_decoder_t * | ps, |
int | sf, | ||
int | ef, | ||
char const * | ctx1, | ||
char const * | ctx2 | ||
) |
Get an iterator over the best hypotheses, optionally within a selected region of the utterance.
Iterator is empty now, it must be advanced with ps_nbest_next first. The function may also return a NULL which means that there is nohypothesis available for this utterance.
ps | Decoder. |
sf | Start frame for N-best search (0 for whole utterance) |
ef | End frame for N-best search (-1 for whole utterance) |
ctx1 | First word of trigram context (NULL for whole utterance) |
ctx2 | First word of trigram context (NULL for whole utterance) |
Definition at line 961 of file pocketsphinx.c.
References ps_get_lattice(), and ps_decoder_s::search.
POCKETSPHINX_EXPORT void ps_nbest_free | ( | ps_nbest_t * | nbest | ) |
Finish N-best search early, releasing resources.
nbest | N-best iterator. |
Definition at line 995 of file pocketsphinx.c.
References ps_astar_finish().
Referenced by ps_nbest_next().
POCKETSPHINX_EXPORT char const* ps_nbest_hyp | ( | ps_nbest_t * | nbest, |
int32 * | out_score | ||
) |
Get the hypothesis string from an N-best list iterator.
nbest | N-best iterator. |
out_score | Output: Path score for this hypothesis. |
Definition at line 1014 of file pocketsphinx.c.
References ps_astar_hyp(), and ps_latpath_s::score.
POCKETSPHINX_EXPORT ps_nbest_t* ps_nbest_next | ( | ps_nbest_t * | nbest | ) |
Move an N-best list iterator forward.
nbest | N-best iterator. |
Definition at line 1001 of file pocketsphinx.c.
References ps_astar_next(), and ps_nbest_free().
POCKETSPHINX_EXPORT ps_seg_t* ps_nbest_seg | ( | ps_nbest_t * | nbest, |
int32 * | out_score | ||
) |
Get the word segmentation from an N-best list iterator.
nbest | N-best iterator. |
out_score | Output: Path score for this hypothesis. |
Definition at line 1025 of file pocketsphinx.c.
References ps_astar_seg_iter(), and ps_latpath_s::score.
POCKETSPHINX_EXPORT int ps_process_cep | ( | ps_decoder_t * | ps, |
mfcc_t ** | data, | ||
int | n_frames, | ||
int | no_search, | ||
int | full_utt | ||
) |
Decode acoustic feature data.
ps | Decoder. |
no_search | If non-zero, perform feature extraction but don't do any recognition yet. This may be necessary if your processor has trouble doing recognition in real-time. |
full_utt | If non-zero, this block of data is a full utterance worth of data. This may allow the recognizer to produce more accurate results. |
POCKETSPHINX_EXPORT int ps_process_raw | ( | ps_decoder_t * | ps, |
int16 const * | data, | ||
size_t | n_samples, | ||
int | no_search, | ||
int | full_utt | ||
) |
Decode raw audio data.
ps | Decoder. |
no_search | If non-zero, perform feature extraction but don't do any recognition yet. This may be necessary if your processor has trouble doing recognition in real-time. |
full_utt | If non-zero, this block of data is a full utterance worth of data. This may allow the recognizer to produce more accurate results. |
Definition at line 749 of file pocketsphinx.c.
References ps_decoder_s::acmod, ACMOD_IDLE, acmod_set_grow(), and acmod_s::state.
Referenced by ps_decode_raw().
POCKETSPHINX_EXPORT int ps_reinit | ( | ps_decoder_t * | ps, |
cmd_ln_t * | config | ||
) |
Reinitialize the decoder with updated configuration.
This function allows you to switch the acoustic model, dictionary, or other configuration without creating an entirely new decoding object.
config
, so you must not attempt to free it manually. If you wish to reuse it elsewhere, call cmd_ln_retain() on it.ps | Decoder. |
config | An optional new configuration to use. If this is NULL, the previous configuration will be reloaded, with any changes applied. |
Definition at line 193 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_free(), acmod_init(), ps_decoder_s::config, ps_decoder_s::d2p, ps_decoder_s::dict, dict2pid_free(), dict_free(), ps_decoder_s::lmath, ps_decoder_s::mfclogdir, ps_decoder_s::phone_loop, ps_decoder_s::pl_window, ps_decoder_s::rawlogdir, and ps_decoder_s::senlogdir.
Referenced by ps_init().
POCKETSPHINX_EXPORT ps_decoder_t* ps_retain | ( | ps_decoder_t * | ps | ) |
Retain a pointer to the decoder.
This increments the reference count on the decoder, allowing it to be shared between multiple parent objects. In general you will not need to use this function, ever. It is mainly here for the convenience of scripting language bindings.
Definition at line 319 of file pocketsphinx.c.
References ps_decoder_s::refcount.
POCKETSPHINX_EXPORT int ps_save_dict | ( | ps_decoder_t * | ps, |
char const * | dictfile, | ||
char const * | format | ||
) |
Dump the current pronunciation dictionary to a file.
This function dumps the current pronunciation dictionary to a tex
dictfile | Path to file where dictionary will be written. |
format | Format of the dictionary file, or NULL for the default (text) format (currently unused, should be NULL) |
Definition at line 512 of file pocketsphinx.c.
References ps_decoder_s::dict, and dict_write().
POCKETSPHINX_EXPORT void ps_seg_frames | ( | ps_seg_t * | seg, |
int * | out_sf, | ||
int * | out_ef | ||
) |
Get inclusive start and end frames from a segmentation iterator.
seg | Segment iterator. |
out_sf | Output: First frame index in segment. |
out_sf | Output: Last frame index in segment. |
Definition at line 933 of file pocketsphinx.c.
References ps_seg_s::ef, and ps_seg_s::sf.
POCKETSPHINX_EXPORT ps_seg_t* ps_seg_iter | ( | ps_decoder_t * | ps, |
int32 * | out_best_score | ||
) |
Get an iterator over the word segmentation for the best hypothesis.
ps | Decoder. |
out_best_score | Output: path score corresponding to hypothesis. |
Definition at line 910 of file pocketsphinx.c.
References ps_decoder_s::perf.
Get the next segment in a word segmentation.
seg | Segment iterator. |
Definition at line 921 of file pocketsphinx.c.
POCKETSPHINX_EXPORT int32 ps_seg_prob | ( | ps_seg_t * | seg, |
int32 * | out_ascr, | ||
int32 * | out_lscr, | ||
int32 * | out_lback | ||
) |
Get language, acoustic, and posterior probabilities from a segmentation iterator.
out_ascr | Output: acoustic model score for this segment. |
out_lscr | Output: language model score for this segment. |
out_lback | Output: language model backoff mode for this segment (i.e. the number of words used in calculating lscr). This field is, of course, only meaningful for N-Gram models. |
Definition at line 940 of file pocketsphinx.c.
References ps_seg_s::ascr, ps_seg_s::lback, ps_seg_s::lscr, and ps_seg_s::prob.
POCKETSPHINX_EXPORT char const* ps_seg_word | ( | ps_seg_t * | seg | ) |
Get word string from a segmentation iterator.
seg | Segment iterator. |
Definition at line 927 of file pocketsphinx.c.
References ps_seg_s::word.
POCKETSPHINX_EXPORT int ps_start_utt | ( | ps_decoder_t * | ps, |
char const * | uttid | ||
) |
Start utterance processing.
This function should be called before any utterance data is passed to the decoder. It marks the start of a new utterance and reinitializes internal data structures.
ps | Decoder to be started. |
uttid | String uniquely identifying this utterance. If NULL, one will be created. |
Definition at line 621 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_set_mfcfh(), acmod_set_rawfh(), acmod_set_senfh(), acmod_start_utt(), ps_search_s::dag, ps_search_s::hyp_str, ps_search_s::last_link, ps_decoder_s::mfclogdir, ps_decoder_s::perf, ps_decoder_s::phone_loop, ps_search_s::post, ps_lattice_free(), ps_decoder_s::rawlogdir, ps_decoder_s::search, ps_decoder_s::senlogdir, ps_decoder_s::uttid, and ps_decoder_s::uttno.
Referenced by ps_decode_raw(), and ps_decode_senscr().
POCKETSPHINX_EXPORT fsg_set_t* ps_update_fsgset | ( | ps_decoder_t * | ps | ) |
Update the finite-state grammar set object for this decoder.
This function does several things. Most importantly, it enables FSG decoding if not currently enabled. It also updates internal data structures to reflect any changes made to the FSG set.
Definition at line 432 of file pocketsphinx.c.
References ps_decoder_s::acmod, ps_decoder_s::config, ps_decoder_s::d2p, ps_decoder_s::dict, ps_decoder_s::phone_loop, ps_search_s::pls, and ps_decoder_s::searches.
POCKETSPHINX_EXPORT ngram_model_t* ps_update_lmset | ( | ps_decoder_t * | ps, |
ngram_model_t * | lmset | ||
) |
Update the language model set object for this decoder.
This function does several things. Most importantly, it enables N-Gram decoding if not currently enabled. It also updates internal data structures to reflect any changes made to the language model set (e.g. switching language models, adding words, etc).
lmset | The new lmset to use, or NULL to update the existing lmset. The decoder retains ownership of this pointer, so you should not attempt to free it manually. Use ngram_model_retain() if you wish to reuse it elsewhere. |
Definition at line 389 of file pocketsphinx.c.
References ps_decoder_s::acmod, ps_decoder_s::config, ps_decoder_s::d2p, ps_decoder_s::dict, ngram_search_s::lmset, ngram_search_init(), ps_decoder_s::phone_loop, ps_search_s::pls, and ps_decoder_s::searches.
POCKETSPHINX_EXPORT ps_mllr_t* ps_update_mllr | ( | ps_decoder_t * | ps, |
ps_mllr_t * | mllr | ||
) |
Adapt current acoustic model using a linear transform.
mllr | The new transform to use, or NULL to update the existing transform. The decoder retains ownership of this pointer, so you should not attempt to free it manually. Use ps_mllr_retain() if you wish to reuse it elsewhere. |
Definition at line 374 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_update_mllr().