# saiReleaseRecognizer

Releases a recognizer instance and de-allocates recognizer engine resources.

#### Prototype

DWORD saiReleaseRecognizer ( SAI_RECOGNIZER_HANDLE recog H d )

Argument | Description
recogHd | Handle associated with a recognizer resource.

#### Return values

Return value | Description
SUCCESS |
SAIERR_ENGINE_NOT_READY | Specified recognizer engine is not ready to handle requests.
SAIERR_INVALID_PARAMETER | recog H d is invalid.

#### Details

saiReleaseRecognizer de-allocates recognizer resources associated with a specified speech server. If saiReleaseRecognizer executes successfully, the recognizer enters a deletion state and the SAI service deletes the recognizer object after the server responds. Until the server responds, the SAI service returns an SAIERR_ENGINE_NOT_READY error in response to any requests associated with the associated recog H d.

If recog Hd is not associated with a recognizer, the handle is not freed and the application receives SAIERR_INVALID_PARAMETER.

For more information, refer to Creating recognizer resources.

#### See also

saiCreateRecognizer

#### Example

// Destruction of ASR engine object using SAI function. Its handle is equal to 0.
// The application does not need to wait on the event queue to receive a specific event
// because SAI service releases all recognition engine trace.
//
DWORD demoAsrRelease( SAI_RECOGNIZER_HANDLE *recogHd, DWORD *serverPortAsr)
{
DWORD rc = SUCCESS;
rc = saiReleaseRecognizer(*asrHd );
if ( rc == SUCCESS )
{
printf("Releasing ASR succeed.\n");
*serverPortAsr = 0;
*asrHd = 0;
}
else
{
printf("Failure on releasing ASR, error code = 0x%08x.\n", rc);
}
return rc;
}