PocketSphinx
5prealpha
|
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 <pocketsphinx_export.h>
#include <cmdln_macro.h>
#include <ps_lattice.h>
#include <ps_mllr.h>
#include <ps_search.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 void | ps_default_search_args (cmd_ln_t *) |
Sets default grammar and language model if they are not set explicitly and are present in the default search path. | |
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 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 char * | ps_lookup_word (ps_decoder_t *ps, const char *word) |
Lookup for the word in the dictionary and return phone transcription for it. More... | |
POCKETSPHINX_EXPORT long | ps_decode_raw (ps_decoder_t *ps, FILE *rawfh, long maxsamps) |
Decode a raw audio stream. More... | |
POCKETSPHINX_EXPORT int | ps_decode_senscr (ps_decoder_t *ps, FILE *senfh) |
Decode a senone score dump file. More... | |
POCKETSPHINX_EXPORT int | ps_start_stream (ps_decoder_t *ps) |
Start processing of the stream of speech. More... | |
POCKETSPHINX_EXPORT int | ps_start_utt (ps_decoder_t *ps) |
Start utterance processing. 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) |
Get hypothesis string and path score. More... | |
POCKETSPHINX_EXPORT int32 | ps_get_prob (ps_decoder_t *ps) |
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) |
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) |
Get an iterator over the best hypotheses. 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) |
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... | |
POCKETSPHINX_EXPORT uint8 | ps_get_in_speech (ps_decoder_t *ps) |
Checks if the last feed audio buffer contained speech. More... | |
POCKETSPHINX_EXPORT void | ps_set_rawdata_size (ps_decoder_t *ps, int32 size) |
Sets the limit of the raw audio data to store in decoder to retrieve it later on ps_get_rawdata. More... | |
POCKETSPHINX_EXPORT void | ps_get_rawdata (ps_decoder_t *ps, int16 **buffer, int32 *size) |
Retrieves the raw data collected during utterance decoding. 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 792 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_decoder_s::searches.
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 407 of file pocketsphinx.c.
Referenced by ps_load_dict().
POCKETSPHINX_EXPORT long ps_decode_raw | ( | ps_decoder_t * | ps, |
FILE * | rawfh, | ||
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. |
maxsamps | Maximum number of samples to read from rawfh, or -1 to read until end-of-file. |
Definition at line 883 of file pocketsphinx.c.
References ps_end_utt(), ps_process_raw(), ps_start_stream(), and ps_start_utt().
POCKETSPHINX_EXPORT int ps_decode_senscr | ( | ps_decoder_t * | ps, |
FILE * | senfh | ||
) |
Decode a senone score dump file.
ps | Decoder |
fh | Previously opened file handle positioned at start of file. |
Definition at line 1036 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 1124 of file pocketsphinx.c.
References ps_decoder_s::acmod, acmod_end_utt(), ACMOD_ENDED, ACMOD_IDLE, ps_decoder_s::config, acmod_s::output_frame, ps_decoder_s::perf, ps_decoder_s::phone_loop, ps_decoder_s::pl_window, ps_get_hyp(), ps_get_logmath(), ps_seg_frames(), ps_seg_iter(), ps_seg_next(), ps_seg_prob(), ps_seg_word(), ps_decoder_s::search, and acmod_s::state.
Referenced by ps_decode_raw(), and 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 420 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, and ps_decoder_s::refcount.
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 1353 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 437 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 449 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 455 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::fcb.
POCKETSPHINX_EXPORT char const* ps_get_hyp | ( | ps_decoder_t * | ps, |
int32 * | out_best_score | ||
) |
Get hypothesis string and path score.
ps | Decoder. |
out_best_score | Output: path score corresponding to returned string. |
Definition at line 1190 of file pocketsphinx.c.
References ps_decoder_s::perf, and ps_decoder_s::search.
Referenced by ps_end_utt().
POCKETSPHINX_EXPORT uint8 ps_get_in_speech | ( | ps_decoder_t * | ps | ) |
Checks if the last feed audio buffer contained speech.
ps | Decoder. |
Definition at line 1365 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::fe.
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 1259 of file pocketsphinx.c.
References ps_decoder_s::search.
Referenced by ps_nbest().
POCKETSPHINX_EXPORT logmath_t* ps_get_logmath | ( | ps_decoder_t * | ps | ) |
Get the log-math computation object for this decoder.
Definition at line 443 of file pocketsphinx.c.
References ps_decoder_s::lmath.
Referenced by ps_end_utt().
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 1335 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_s::output_frame.
POCKETSPHINX_EXPORT int32 ps_get_prob | ( | ps_decoder_t * | ps | ) |
Get posterior probability.
ps | Decoder. |
Definition at line 1201 of file pocketsphinx.c.
References ps_decoder_s::perf, and ps_decoder_s::search.
POCKETSPHINX_EXPORT void ps_get_rawdata | ( | ps_decoder_t * | ps, |
int16 ** | buffer, | ||
int32 * | size | ||
) |
Retrieves the raw data collected during utterance decoding.
ps | Decoder |
buffer | preallocated buffer to store the data, must be within the limit set before |
size | size of the data collected in samples (not bytes). |
Definition at line 1446 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_get_rawdata().
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 1341 of file pocketsphinx.c.
References ps_decoder_s::acmod, ps_decoder_s::config, acmod_s::output_frame, and ps_decoder_s::perf.
POCKETSPHINX_EXPORT ps_decoder_t* ps_init | ( | cmd_ln_t * | config | ) |
Initialize the decoder from a configuration object.
config
, so if you are not going to use it elsewere, you can free it.config | a command-line structure, as created by cmd_ln_parse_r() or cmd_ln_parse_file_r(). |
Definition at line 388 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 732 of file pocketsphinx.c.
References ps_decoder_s::acmod, ps_decoder_s::config, ps_decoder_s::d2p, ps_decoder_s::dict, dict2pid_build(), dict2pid_free(), dict_free(), dict_init(), acmod_s::mdef, ps_args(), and ps_decoder_s::searches.
POCKETSPHINX_EXPORT char* ps_lookup_word | ( | ps_decoder_t * | ps, |
const char * | word | ||
) |
Lookup for the word in the dictionary and return phone transcription for it.
ps | Pocketsphinx decoder |
word | Word to look for |
word
or NULL if word is not present in the dictionary. The string is allocated and must be freed by the user. Definition at line 860 of file pocketsphinx.c.
References BAD_S3WID, ps_decoder_s::dict, dict_ciphone_str(), and dict_wordid().
POCKETSPHINX_EXPORT ps_nbest_t* ps_nbest | ( | ps_decoder_t * | ps | ) |
Get an iterator over the best hypotheses.
The function may also return a NULL which means that there is no hypothesis available for this utterance.
ps | Decoder. |
Definition at line 1265 of file pocketsphinx.c.
References ps_astar_start(), ps_get_lattice(), ps_nbest_next(), 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 1296 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 1315 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 1302 of file pocketsphinx.c.
References ps_astar_next(), and ps_nbest_free().
Referenced by ps_nbest().
POCKETSPHINX_EXPORT ps_seg_t* ps_nbest_seg | ( | ps_nbest_t * | nbest | ) |
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 1326 of file pocketsphinx.c.
References ps_astar_seg_iter().
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 1057 of file pocketsphinx.c.
References ps_decoder_s::acmod, ACMOD_IDLE, acmod_process_raw(), 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 218 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_build(), dict2pid_free(), dict_free(), dict_init(), ps_decoder_s::lmath, acmod_s::mdef, ps_decoder_s::mfclogdir, ps_decoder_s::perf, ps_decoder_s::phone_loop, ps_set_allphone_file(), ps_set_fsg(), ps_set_jsgf_file(), ps_set_keyphrase(), ps_set_kws(), ps_set_lm(), ps_set_lm_file(), ps_set_search(), ps_decoder_s::rawlogdir, ps_decoder_s::searches, 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 413 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 785 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 1235 of file pocketsphinx.c.
References ps_search_s::acmod, acmod_stream_offset(), ps_seg_s::ef, ps_seg_s::search, and ps_seg_s::sf.
Referenced by ps_end_utt().
POCKETSPHINX_EXPORT ps_seg_t* ps_seg_iter | ( | ps_decoder_t * | ps | ) |
Get an iterator over the word segmentation for the best hypothesis.
ps | Decoder. |
Definition at line 1212 of file pocketsphinx.c.
References ps_decoder_s::perf, and ps_decoder_s::search.
Referenced by ps_end_utt().
Get the next segment in a word segmentation.
seg | Segment iterator. |
Definition at line 1223 of file pocketsphinx.c.
Referenced by ps_end_utt().
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 1244 of file pocketsphinx.c.
References ps_seg_s::ascr, ps_seg_s::lback, ps_seg_s::lscr, and ps_seg_s::prob.
Referenced by ps_end_utt().
POCKETSPHINX_EXPORT char const* ps_seg_word | ( | ps_seg_t * | seg | ) |
Get word string from a segmentation iterator.
seg | Segment iterator. |
Definition at line 1229 of file pocketsphinx.c.
References ps_seg_s::word.
Referenced by ps_end_utt().
POCKETSPHINX_EXPORT void ps_set_rawdata_size | ( | ps_decoder_t * | ps, |
int32 | size | ||
) |
Sets the limit of the raw audio data to store in decoder to retrieve it later on ps_get_rawdata.
ps | Decoder |
size | bytes of the utterance to store |
Definition at line 1440 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_set_rawdata_size().
POCKETSPHINX_EXPORT int ps_start_stream | ( | ps_decoder_t * | ps | ) |
Start processing of the stream of speech.
Channel parameters like noise-level are maintained for the stream and reused among utterances. Times returned in segment iterators are also stream-wide.
Definition at line 926 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_start_stream().
Referenced by ps_decode_raw().
POCKETSPHINX_EXPORT int ps_start_utt | ( | ps_decoder_t * | ps | ) |
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. |
Definition at line 933 of file pocketsphinx.c.
References ps_decoder_s::acmod, ACMOD_PROCESSING, acmod_set_mfcfh(), acmod_set_rawfh(), acmod_set_senfh(), acmod_start_utt(), ACMOD_STARTED, 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, acmod_s::state, and ps_decoder_s::uttno.
Referenced by ps_decode_raw(), and ps_decode_senscr().
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 461 of file pocketsphinx.c.
References ps_decoder_s::acmod, and acmod_update_mllr().