Browse
 
Tools
Rss Categories

LV_SRE_DestroyClient

Reference Number: AA-00676 Views: 2174 0 Rating/ Voters

Safely destroys a speech port, releasing control of the acquired license and other associated resources back to the server.

Function

  • int LV_SRE_DestroyClient(HPORT hport)

Parameters

hport

The port's handle.

Return Values

LV_SUCCESS

The port has been successfully destroyed.

LV_INVALID_HPORT

The input hport is not a valid one.

LV_EXCEPTION

An exception occurred while processing the request.

Remarks

Each open port requires one license. For this reason, you should close every port as soon as it is no longer needed.

C code

  1. void main()
  2. {
  3. char *grammar_label = "MyGram";
  4. char *grammar_file_path = "builtin:grammar/digits";
  5. char *audio_file_path = "1234.ulaw";

  6. InitializePort();
  7. LoadGrammar(grammar_label, grammar_file_path);
  8. Audio_Stream(audio_file_path);

  9. // Load and use other assets appropriate to the function of the program.

  10. // Here, DestroyClient is the last thing called before the program terminates.
  11. LV_SRE_DestroyClient(hport);
  12. }

See Also