When the speech port is no longer needed it should be closed. Closing unnecessary speech ports frees up licenses, and releases all of the speech port's resources.
C Code
-
HPORT hport;
-
/* After the port has been opened and recognitions are complete, close it: */
-
C++ Code
-
LVSpeechPort port;
-
// After the port has been opened and recognitions are complete, close it:
-
While closing the port may seem trivial, as soon as you start streaming audio to the port from a separate thread, the trivial can be problematic. Remember to completely disengage your stream from the port before you close it.