All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
VCD User Functions

Functions

VCD_API VCD_MessageEnum VCD_init (VCD_Handle *pmh, VCD_ConfigStruct *config)
 
VCD_API VCD_MessageEnum VCD_startEnroll (VCD_Handle vh, char const *name)
 
VCD_API VCD_MessageEnum VCD_processFrame (VCD_Handle vh, int_least16_t const *data)
 
VCD_API VCD_MessageEnum VCD_getEnrollQuality (VCD_Handle vh, int_least16_t *quality)
 
VCD_API VCD_MessageEnum VCD_getEnrollDifference (VCD_Handle vh, int_least16_t *difference)
 
VCD_API VCD_MessageEnum VCD_addEnroll (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_stopEnroll (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_startUpdate (VCD_Handle vh, char const *name)
 
VCD_API VCD_MessageEnum VCD_addUpdate (VCD_Handle vh, int_least16_t priorUpdates)
 
VCD_API VCD_MessageEnum VCD_stopUpdate (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_startSearch (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_stopSearch (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_getResult (VCD_Handle vh, VCD_Reco result)
 
VCD_API VCD_MessageEnum VCD_resetSearch (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_getModelInfo (VCD_Handle vh, char const *name, int_least16_t index, VCD_ModelInfo info)
 
VCD_API VCD_MessageEnum VCD_removeModel (VCD_Handle vh, char const *name, int_least16_t index)
 
VCD_API VCD_MessageEnum VCD_disableModel (VCD_Handle vh, char *name, int_least16_t index)
 
VCD_API VCD_MessageEnum VCD_enableModel (VCD_Handle vh, char *name, int_least16_t index)
 
VCD_API VCD_MessageEnum VCD_getParams (VCD_Handle vh, VCD_Params params)
 
VCD_API VCD_MessageEnum VCD_setParams (VCD_Handle vh, VCD_Params params)
 
VCD_API VCD_MessageEnum VCD_shutdown (VCD_Handle vh)
 
VCD_API VCD_MessageEnum VCD_checkValidModel (int_least16_t *address)
 
VCD_API VCD_MessageEnum VCD_addList (VCD_Handle vh, int_least16_t **modelsList, int_least16_t numModels)
 
VCD_API VCD_MessageEnum VCD_writeModel (VCD_Handle vh, int_least16_t *ptrModel, int_least32_t mSize, int_least16_t **mAddress)
 
VCD_API VCD_MessageEnum VCD_clearModel (int_least16_t *mAddress)
 
VCD_MessageEnum VCD_updateModel (VCD_Handle vh, int_least16_t *ptrModel, int_least32_t mSize, int_least16_t *mAddress)
 

Detailed Description

The top-level user interface functions within VCD. These functions provide the entire functionality of VCD to the user.

Function Documentation

VCD_API VCD_MessageEnum VCD_init ( VCD_Handle pmh,
VCD_ConfigStruct config 
)

Initialize an instance of the VCD recognizer. Provides a handle to the new recognizer instance. Initializes all parameters to default values. This must be the first function called when starting to use VCD.

Parameters
[in,out]pmhPointer to a VCD_Handle to be set
[in]configPointer to VCD_ConfigStruct for memory allocation
Returns
Message indicating status of initialization
VCD_API VCD_MessageEnum VCD_startEnroll ( VCD_Handle  vh,
char const *  name 
)

Set processing mode and prepare for enrolling a new model. Does initialization of VCD so that the data frames susequently processed by VCD_processFrame perform model enrollment. The model will be assigned to the lowest available model index.

Parameters
[in]vhVCD instance VCD_Handle
[in]nameName of model to enroll. Model names must be unique.
Returns
Message indicating status of call
VCD_API VCD_MessageEnum VCD_processFrame ( VCD_Handle  vh,
int_least16_t const *  data 
)

Process the incoming speech data frame based on processing mode. The frames can be processed only after setting the intended mode of operation by calling VCD_startEnroll, VCD_startUpdate, or VCD_startSearch. This function will return an error otherwise. The processing performed depends on which of the functions was called.

When VCD_startSearch has been called, this function will process a frame of captured audio data in the recognizer. Initially a number of data frames are required to set start-up parameters and the data is buffered for the number of frames prior to starting the search engine. Thus the recognizer search engine is running behind actual input data. The user should continue calling this function to process additional captured data frames. When the function returns VCD_MsgRecoComplete, the recognizer has a result. The user must call VCD_getResult to obtain the recognition result. After obtaining the recognition result, VCD_resetSearch may be called followed by further calls to this function to continue recognition. Recognition search must be terminated by calling VCD_stopSearch.

To process remaining buffered frames when no further data is available, this function can be called with data set to NULL, until the recognizer returns VCD_MsgRecoComplete, after which the user must call VCD_stopSearch.

When VCD_startEnroll has been called the function will process each data frame to try to locate a speech utterance. All frames deemed to be part of an utterance will be used to create the new model. The return value will indicate the status for each frame passed to the function. Frames of data should continue to be passed to the function until it indicates it successfully found a phrase, or a failure message occurs. Enrollment should be done in a quiet environment to ensure accurate location of speech. Once successful enrollment is indicated, the new model can be stored for use by VCD by calling VCD_addEnroll. VCD_stopEnroll must be called to exit the enrollment mode.

When VCD_startUpdate has been called the function will process each frame to try to match the speech data to the model to be updated. The return value will indicate the status for each frame passed to the function. Frames of data should continue to be passed to the function until it indicates it successfully mapped the speech data to the existing model by returning VCD_MsgKeywordFound, or a failure message occurs. Update should be done in a quiet environment to ensure accurate mapping of input speech to the existing model. Once successful update is indicated, the updated model data can be incorporated in the model by a call to VCD_addUpdate. VCD_stopUpdate must be called to exit the update mode.

Parameters
[in]vhVCD instance VCD_Handle
[in]dataPointer to a frame of data
Returns
Message indicating status result of processing the frame of data
VCD_API VCD_MessageEnum VCD_getEnrollQuality ( VCD_Handle  vh,
int_least16_t *  quality 
)

Get the enrolled model quality score. This function provides a a measure between 0 and 1 that indicates if an enrolled phrase is likely to provide good recognition results. Phrases will provide better recognition results if they contain significant speech acoustic context. This function should be called only after VCD_processFrame returns the status message VCD_MsgKeywordFound, indicating it successfully located the enrollment utterance. The results of this function can be used to determine if the enrollment utterance should be saved by calling VCD_addEnroll, or whether the user should be notified to provide a better phrase.

Parameters
[in]vhVCD instance VCD_Handle
[out]qualityThe quality of the enrolled utterance 0-1 in Q15.
Returns
Message indicating status of saving enrolled model
VCD_API VCD_MessageEnum VCD_getEnrollDifference ( VCD_Handle  vh,
int_least16_t *  difference 
)

Get the enrolled model difference with all other currently existing models. This function provides a a measure between 0 (very similar) and 1 (very different) that indicates how different an enrolled phrase is from all other currently enrolled models. Enrolling models that are signifcantly different is likely to provide good recognition results for all enrolled phrases. This function should be called while enrolling after VCD_processFrame returns the status message VCD_MsgKeywordFound, indicating it successfully located the enrollment utterance. The results of this function can be used to determine if the enrollment utterance should be saved by calling VCD_addEnroll, or whether the user should be notified to provide a different phrase.

Parameters
[in]vhVCD instance VCD_Handle
[out]differenceThe difference measure between 0-1 in Q15.
Returns
Message indicating status of saving enrolled model
VCD_API VCD_MessageEnum VCD_addEnroll ( VCD_Handle  vh)

Add the enrolled model to the VCD active model set. This will save the enrollment model, adding it to the set of models. This function should be called only after VCD_processFrame returns the status message VCD_MsgKeywordFound, indicating it successfully located the enrollment utterance. The newly enrolled model will be enabled for recognition. Prior to calling this function, VCD_getEnrollQuality may be called to determine if the enrollment model should be added.

Parameters
[in]vhVCD instance VCD_Handle
Returns
Message indicating status of saving enrolled model
VCD_API VCD_MessageEnum VCD_stopEnroll ( VCD_Handle  vh)

End the enrollment mode of VCD. Calling this function ends the enrollment of a model. It can be called at any time after successfully calling VCD_startEnroll, and must be called to end the enrollment processing.

Parameters
[in]vhVCD instance VCD_Handle
Returns
Message indicating status of ending enrollment
VCD_API VCD_MessageEnum VCD_startUpdate ( VCD_Handle  vh,
char const *  name 
)

Set processing mode and prepare for updating an existing model. Sets VCD so that the data frames that will be processed by VCD_processFrame perform model update to improve the model. Currently only update of Left-to-right models is supported.

Parameters
[in]vhVCD instance VCD_Handle
[in]nameName of model to update
Returns
Message indicating status of call
VCD_API VCD_MessageEnum VCD_addUpdate ( VCD_Handle  vh,
int_least16_t  priorUpdates 
)

Update the model based on the update result. This function updates model data in model memory based on the data received during update frame processing. This function should only be called after VCD_processFrame triggers the status message VCD_MsgKeywordFound, indicating it successfully mapped the update data to the model. The updated model will be enabled for recognition.

The function provides a means of weighting the relative importance of the update compared with the accumulated prior updates. To adjust weighting during the update, specify a positive integer value that acts as the prior number of occurrences for the accumulated model data. In this way varied emphasis can be put on the accumulated data relative to the update data. If the prior number of occurrences are zero or less, then 1 is used.

Parameters
[in]vhVCD instance VCD_Handle
[in]priorUpdatesWeighting for the importance of accumulated updates
Returns
Message indicating status of saving enrolled model
VCD_API VCD_MessageEnum VCD_stopUpdate ( VCD_Handle  vh)

End the update mode of VCD. Calling this function ends the update of a model. It can be called at any time after successfully calling VCD_startUpdate, and must be called to end the update processing.

Parameters
[in]vhVCD instance VCD_Handle
Returns
Message indicating status of ending update
VCD_API VCD_MessageEnum VCD_startSearch ( VCD_Handle  vh)

Set mode and prepare for recognition search.

Parameters
[in]vhVCD instance VCD_Handle
Returns
Message indicating status of starting the recognition mode
VCD_API VCD_MessageEnum VCD_stopSearch ( VCD_Handle  vh)

Stop the recognition mode. Stop recognition, freeing any allocated resources.

Parameters
[in]vhVCD instance VCD_Handle
Returns
Message indicating status of stopping the recognition mode
VCD_API VCD_MessageEnum VCD_getResult ( VCD_Handle  vh,
VCD_Reco  result 
)

Retrieve the recognition results. Places recognition results in a VCD_RecoStruct. The structure that result points to must be allocated. This function must be called immediately after VCD_processFrame returns VCD_MsgRecoComplete. If the score is too low, or the keyword model is not found, then the result contains the hypothesized model and score, even though it should not be trusted. The best hypothesized model index may be less than zero if a valid model is not the best hypothesis when the recognizer terminates, such as when the keyword model is not found. If no valid hypothesized word is available, then name pointer will be NULL.

Parameters
[in]vhVCD instance VCD_Handle
[in,out]resultPointer to recognition structure to hold results
Returns
Message indicating status of obtaining recognition results
VCD_API VCD_MessageEnum VCD_resetSearch ( VCD_Handle  vh)

Reset search to begin processing a new utterance. Reset search scores and parameters, and reset front-end utterance detector to start recognizing another utterance immediately after a recognition result is returned. This occurs when VCD_processFrame returns VCD_MsgRecoComplete. This function is used to continue processing of subsequent frames so recognition can be done continuously. It must not be called after searching has been stopped by a call to VCD_stopSearch.

Parameters
[in]vhVCD handle
Returns
Status indicating result of resetting search
VCD_API VCD_MessageEnum VCD_getModelInfo ( VCD_Handle  vh,
char const *  name,
int_least16_t  index,
VCD_ModelInfo  info 
)

Retrieve information about a model by name or index. Put the data in a model information structure. The user must manage the instantiation of the structure. VCD_init must be called prior to this function to create a valid VCD_Handle instance. This function must not be called after calling VCD_shutdown, which invalidates the VCD_Handle instance. The structure also returns the number of valid models. Model indices are zero-based. Model index 0 is a special unique Filler model. The valid models will be in consecutive index order.

Parameters
[in]vhVCD handle
[in]nameName of the model. If NULL, use model index
[in]indexIndex of model. Not used if name specifies a model.
[in,out]infoPointer to model info structure to hold results
Returns
Message indicating status of obtaining model information
VCD_API VCD_MessageEnum VCD_removeModel ( VCD_Handle  vh,
char const *  name,
int_least16_t  index 
)

Remove a model with the given name or index. Model indices are zero-based. Model index 0 is a special unique Filler model which can not be removed. The valid model indices will be in consecutive order. If a valid name is given, then index is not used.

Parameters
[in]vhVCD handle
[in]nameName of model to be removed. Set to NULL to use index.
[in]indexModel index corresponding to model data to removed
Returns
Message indicating status of removing model
VCD_API VCD_MessageEnum VCD_disableModel ( VCD_Handle  vh,
char *  name,
int_least16_t  index 
)

Disable the model with the given name or index for use during recognition. A disabled model will not be used during recognition. If the model that is currently set as the filler model (see VCD_ParamsStruct) is disabled, then no filler model processing will be done. If the model that is currently set as the keyword model (see VCD_ParamsStruct) is disabled, then no keyword early commit will be done. Model indices are zero-based. Model index 0 is a special unique Filler model. The valid model indices will be in consecutive order. If a name is given, index will not be used.

Parameters
[in]vhVCD handle
[in]nameName of model to disable. Set to NULL to use index.
[in]indexIndex of model to disable
Returns
Message indicating status of disabling model
VCD_API VCD_MessageEnum VCD_enableModel ( VCD_Handle  vh,
char *  name,
int_least16_t  index 
)

Enable the model with the given name or index to be used during recognition

An enabled model will be used during recognition. Model indices are zero-based. Model index 0 is a special unique Filler model. The valid model indices will be in consecutive. If a name is given, index will not be used.

Parameters
[in]vhVCD handle
[in]nameName of the model to enable. Set to NULL to use index.
[in]indexIndex of model to enable
Returns
Message indicating status of enabling model
VCD_API VCD_MessageEnum VCD_getParams ( VCD_Handle  vh,
VCD_Params  params 
)

Get parameter settings currently used by VCD Once a VCD instance is initialized, the parameters that are used during the processing can modified if required. These parameters are set to the default values in the call to VCD_init. This function fills the VCD_Params structure with the parameters that are currently in use.

Parameters
[in]vhVCD handle
[in,out]paramsPointer to VCD_Params structure to be filled
Returns
Message indicating status of getting parameters
VCD_API VCD_MessageEnum VCD_setParams ( VCD_Handle  vh,
VCD_Params  params 
)

Set the VCD parameters. This function uses the parameters in the VCD_Params structure params to update the parameters used by VCD.

Parameters
[in]vhVCD handle
[in,out]paramsPointer to VCD_Params structure holding data to set
Returns
Message indicating status of setting parameters
VCD_API VCD_MessageEnum VCD_shutdown ( VCD_Handle  vh)

Shut down the instance of the VCD recognizer. Free any resources that VCD may have used. This must be called as the last part of using a recognizer instance to ensure that all resources have been relinquished.

Parameters
[in]vhVCD handle
Returns
Message indicating status of shutting down the VCD instance
VCD_API VCD_MessageEnum VCD_checkValidModel ( int_least16_t *  address)

Check if there is a valid model stored at the given address.

Parameters
[in]addressThe address at which to check if there is a valid model
Returns
Message indicating whether there is a valid model at the given address
VCD_API VCD_MessageEnum VCD_addList ( VCD_Handle  vh,
int_least16_t **  modelsList,
int_least16_t  numModels 
)

Function to add a list of models to the model map.

Parameters
[in]vhVCD handle
[in]modelsListAn array of pointers that each point to where a valid model is stored in memory
[in]numModelsThe number of models to add
Returns
Message indicating the status of adding the list of models
VCD_API VCD_MessageEnum VCD_writeModel ( VCD_Handle  vh,
int_least16_t *  ptrModel,
int_least32_t  mSize,
int_least16_t **  mAddress 
)

Application defined function to write the model data to memory. The user should not call this function in their application. This function will be called by VCD during VCD_addEnroll().

Parameters
[in]vhVCD handle
[in]ptrModelPointer to where the beginning of the model data is stored in shared memory
[in]mSizeTotal size in bytes of the model data
[in]mAddressPointer to where the user has stored the model in memory
Returns
Message indicating status of writing the model to memory
VCD_API VCD_MessageEnum VCD_clearModel ( int_least16_t *  mAddress)

Application defined function to clear a model from memory. The user should not call this function in their application. This function will be called by VCD during VCD_removeModel().

Parameters
[in]mAddressThe address that points to the model that should be cleared from memory
Returns
Message indicating the status of clearing a model form memory
VCD_MessageEnum VCD_updateModel ( VCD_Handle  vh,
int_least16_t *  ptrModel,
int_least32_t  mSize,
int_least16_t *  mAddress 
)

Function to update model data in memory with updated modal data. The user should not call this function in their application. This function will be called by VCD during VCD_addUpdate().

Parameters
[in]vhVCD handle
[in]ptrModelPointer to where the beginning of the updated model data is stored in shared memory
[in]mSizeThe size in bytes of the updated model data
[in]mAddressThe address of the model data to overwrite with the updated model data
Returns
Message indicating the status of writing the updated model data to memory
Copyright 2017, Texas Instruments Incorporated