saiReleaseSynthesizer

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

Prototype

DWORD saiReleaseSynthesizer ( SAI_SYNTHESIZER_HANDLE synthHd )

Argument

Description

synthHd

Handle associated with a synthesizer resource.


Return values

Return value

Description

SUCCESS

 

SAIERR_ENGINE_NOT_READY

Specified synthesizer engine is not ready to handle the request.

SAIERR_INVALID_PARAMETER

synthHd is invalid.


Details

saiReleaseSynthesizer de-allocates a synthesizer resource from a speech server. If saiReleaseSynthesizer executes successfully, the synthesizer enters a deletion state and the synthesizer object is deleted after the server responds. The SAI service returns an error in response to any subsequent requests for the specified synthHd.

If the specified synthHd is not associated with a synthesizer, the handle is not freed and the SAI service returns SAIERR_INVALID_PARAMETER.

For more information, refer to Creating synthesizer resources.

See also

saiCreateSynthesizer

Example

// Destruction of TTS engine object using SAI function. Its handle is equalled to 0.
// The Application does not need to wait on the event queue to receive a specific event
// because SAI services take care to release all synthesis engine trace.
//                               
DWORD demoTtsRelease( SAI_SYNTHESIZER_HANDLE *ttsHd, DWORD *serverPortTts)
{
    DWORD rc = SUCCESS;

    rc = saiReleaseSynthesizer(*ttsHd );      
    if ( rc == SUCCESS )
    {
       printf("Releasing TTS succeed.\n");
        *serverPortTts = 0;
        *ttsHd = 0;
    }
    else
    {
        printf("Failure on releasing TTS, error code = 0x%08x.\n", rc);
    }

    return rc;
}