Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
SPEVENTLPARAMTYPE
SPEVENTLPARAMTYPE lists objects and data pointers attached to events. SPEVENTLPARAMTYPE specifies the type of the attached data, enabling the application to determine how to access the data, and how to release the data when finished with the event.
See the helper CSpEvent for more information about the C++ class that has properties for accessing event-specific data, and a destructor to automatically cleanup attached data.
See the helper SpClearEvent for more information about releasing objects or memory attached to an event.
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>typedef enum SPEVENTLPARAMTYPE</strong> <strong>{</strong> <strong>SPET_LPARAM_IS_UNDEFINED</strong>, <strong>SPET_LPARAM_IS_TOKEN</strong>, <strong>SPET_LPARAM_IS_OBJECT</strong>, <strong>SPET_LPARAM_IS_POINTER</strong>, <strong>SPET_LPARAM_IS_STRING</strong> <strong>} SPEVENTLPARAMTYPE</strong>; </pre>
Elements
- SPET_LPARAM_IS_UNDEFINED
The SPEVENT.lParam value represents an undefined value.
For example, all TTS events, except SPEI_VOICE_CHANGE and SPEI_TTS_BOOKMARK, do not have attached data, so the event type is SPET_LPARAM_IS_UNDEFINED.
The application does not need to release associated data, since there is no associated data. - SPET_LPARAM_IS_TOKEN
The SPEVENT.lParam value represents a pointer to an ISpObjectToken object.
For example, the TTS voice change event (SPEI_VOICE_CHANGE) includes a pointer to the new voice's object token, so the lParam type is SPET_LPARAM_IS_TOKEN.
The application must call IUnknown::Release on the lParam member (as pointer) to release the associated object token. - SPET_LPARAM_IS_OBJECT
The SPEVENT.lParam value represents a pointer to an object.
For example, the speech recognition event (SPEI_RECOGNITION) includes a pointer to the recognition result (ISpRecoResult), so the lParam type is SPET_LPARAM_IS_OBJECT.
The application must call IUnknown::Release on the lParam member (as pointer) to release the associated object token. - SPET_LPARAM_IS_POINTER
The SPEVENT.lParam value represents a memory pointer.
For example, the property string change event (SPEI_PROPERTY_STRING_CHANGE) includes a pointer to a block of memory that contains a string (such as WCHAR*), so the lParam type is SPET_LPARAM_IS_POINTER.
The application must call CoTaskMemFree on the lParam member (as pointer) to release the associated memory. - SPET_LPARAM_IS_STRING
The SPEVENT.lParam value represents a pointer to a string.
For example, the TTS bookmark event (SPEI_TTS_BOOKMARK) includes a pointer the bookmark name, so the lParam type is SPET_LPARAM_IS_STRING.
The application must call CoTaskMemFree on the lParam member (as pointer) to release the associated memory.