Browse
 
Tools
Rss Categories

LVSpeechPort::DestroyClient

Reference Number: AA-00755 Views: 8353 0 Rating/ Voters

Safely destroys a speech port, releasing the acquired license and other associated resources.

Function

  • int DestroyClient(void)

Return Values

LV_SUCCESS

The port has been successfully destroyed.

LV_INVALID_HPORT

The port is not valid (either CreateClient has not been called or DestroyClient has already been called).

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.

Example

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

  5. port.CreateClient(NULL, NULL, 0);
  6. port.LoadGrammar(grammar_label, grammar_file_path);

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

  8. // DestroyClient is the last thing called before the program terminates.
  9. port.DestroyClient();
  10. }

See Also