Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
SPEVENTEX
SPEVENTEX contains information about an event and extends the SPEVENT structure. Events are passed from the text-to-speech (TTS) or speech recognition (SR) engines or audio devices back to applications.
SPEVENTEX is the same as SPEVENT, with the addition of a field that contains time offset in the audio stream. This is an important additional piece of information because the stream offset itself is not sufficient to calculate the time offset. This is because the stream encoding may be unknown or may have a time-to-data relationship that is non-deterministic (for example, the compressed cepstral format, which is highly lossy).
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>typedef struct SPEVENTEX {</strong> <strong>WORD</strong> <em>eEventId</em>; <strong>WORD</strong> <em>elParamType</em>; <strong>ULONG</strong> <em>ulStreamNum</em>; <strong>ULONGLONG</strong> <em>ullAudioStreamOffset</em>; <strong>WPARAM</strong> <em>wParam</em>; <strong>LPARAM</strong> <em>lParam</em>; <strong>ULONGLONG</strong> <em>ullAudioTimeOffset</em>; <strong>} SPEVENTEX;</strong> </pre>
Members
- eEventId
The event ID of type SPEVENTENUM. - elParamType
The signature of the associated data in the lParam parameter
The application may need to release associated data after using the event. See SPEVENTLPARAMTYPE for more information about associated data. - ulStreamNum
The stream number associated with the event.
For text-to-speech (that is, output streams), the stream number is incremented each time a new speak call (for example ISpVoice::SpeakStream, ISpVoice::Speak) is made.
For speech recognition (that is, input streams), the stream is incremented each time an audio stream is opened. Note that a single audio input object can be opened multiple times (for example buffer overflow, device error, or recognition state change). - ullAudioStreamOffset
The byte offset into the audio stream associated with the event at which the event was fired. For synthesis, the output stream is the synthesized data. For recognition, this indicates the position in the input audio stream. - wParam
The generic word field. For event IDs with the SPFEI_LPARAM_IS_POINTER set, this is the size, in bytes, for the data pointed to by lParam. In some cases, the type of event will change the function of this parameter. See SPEVENTENUM for information about specific events.
See the helper SpClearEvent for more information about releasing objects or memory attached to an event. - lParam
The generic event field. For event IDs with the SPFEI_LPARAM_IS_POINTER set, this points to the data allocated by CoTaskMemAlloc. The caller is responsible for freeing this memory using CoTaskMemFree(). In some cases, the type of event will change the function of this parameter. See SPEVENTENUM for information about specific events.
See the helper SpClearEvent for more information about releasing objects or memory attached to an event. - ullAudioTimeOffset
The time since the beginning of the audio stream, at which this event occurred.