Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

SPPHRASE

SPPHRASE contains information about recognized phrases, including hypotheses, false recognitions, recognitions, and alternate recognitions.

The information in the phrase includes, language, audio and event timing, text (display and lexicon), inverse text replacements, semantic tags (that is, properties), and depending on the engine, an optional block of engine-specific phrase data.

The Microsoft Speech Platform typically provides the application with a pointer to a block of memory that has been allocated by CoTaskMemAlloc, which the application must free using CoTaskMemFree when it is finished with the phrase information.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>typedef struct SPPHRASE</strong> <strong>{</strong> <strong>ULONG</strong> <em>cbSize</em>; <strong>LANGID</strong> <em>LangID</em>; <strong>WORD</strong> <em>wReserved</em>; <strong>ULONGLONG</strong> <em>ullGrammarID</em>; <strong>ULONGLONG</strong> <em>ftStartTime</em>; <strong>ULONGLONG</strong> <em>ullAudioStreamPosition</em>; <strong>ULONG</strong> <em>ulAudioSizeBytes</em>; <strong>ULONG</strong> <em>ulRetainedSizeBytes</em>; <strong>ULONG</strong> <em>ulAudioSizeTime</em>; <a runat="server" href="jj127876(v=msdn.10).md"><strong>SPPHRASERULE</strong></a> <em>Rule</em>; <strong>const</strong> <a runat="server" href="jj127874(v=msdn.10).md"><strong>SPPHRASEPROPERTY</strong></a> *<em>pProperties</em>; <strong>const</strong> <a runat="server" href="jj127873(v=msdn.10).md"><strong>SPPHRASEELEMENT</strong></a> *<em>pElements</em>; <strong>ULONG</strong> <em>cReplacements</em>; <strong>const</strong> <a runat="server" href="jj127875(v=msdn.10).md"><strong>SPPHRASEREPLACEMENT</strong></a> *<em>pReplacements</em>; <strong>GUID</strong> <em>SREngineID</em>; <strong>ULONG</strong> <em>ulSREnginePrivateDataSize</em>; <strong>const BYTE</strong> *<em>pSREnginePrivateData</em>; <strong>LPWSTR</strong> <em>pSML</em>; <a runat="server" href="jj127882(v=msdn.10).md"><strong>SPSEMANTICERRORINFO</strong></a> *<em>pSemanticErrorInfo</em>; <a runat="server" href="jj127479(v=msdn.10).md"><strong>SPSEMANTICFORMAT</strong></a> <em>SemanticTagFormat;</em> <strong>} SPPHRASE;</strong> </pre>

Members

  • cbSize
    The size of this structure in bytes.
  • LangID
    The language ID of the phrase elements.
  • wReserved
    Reserved for future use.
  • ullGrammarID
    ID of the grammar that contains the top-level rule used to recognize this phrase.
  • ftStartTime
    Absolute time for start of phrase audio as a 64-bit value based on the Win32 APIs, SystemTimeToFileTime and GetSystemTime. When an application uses WAV file input, the Speech Platform sets the stream position and start time information to zero.
  • ullAudioStreamPosition
    The starting offset of the phrase in bytes relative to the start of the audio stream. If downsampling an audio stream, ullAudioStreamPosition will be the byte position within the original stream.
  • ulAudioSizeBytes
    Size of audio data, in bytes, for this phrase.
  • ulRetainedSizeBytes
    Size, in bytes, of the retained audio data (in the application-specified retained-audio format).
    See also ISpRecoContext::SetAudioOptions for more information about specifying the retained audio format
  • ulAudioSizeTime
    Length of phrase audio in 100-nanosecond units.
  • Rule
    Information about the top-level rule (and rule-reference hierarchy) used to recognize this phrase.
  • pProperties
    Pointer to the root of the semantic-tag property tree.
  • pElements
    Pointer to the array of phrase elements (the number of elements is contained in Rule). Each phrase element includes position and text information, including lexical and display forms.
  • cReplacements
    Number of text replacements. Text replacements are generally based on engine-defined Inverse Text Normalization rules (for example, recognize "five dollars" as "$5").
  • pReplacements
    Pointer to the array of text replacements.
  • SREngineID
    GUID that identifies the particular speech recognition (SR) engine that recognized this phrase.
  • ulSREnginePrivateDataSize
    Size of the engine's private data, in bytes.
  • pSREnginePrivateData
    Pointer to the engine's private data.
    Engine private data is specific to each SR engine, and the format and structure of the data is not defined by the Speech Platform.
  • pSML
    Pointer to the Semantic Markup Language (SML) that contains the recognition result.
  • pSemanticErrorInfo
    Points to a structure containing the error information if an error occurred while generating the SML.
  • SemanticTagFormat
    Specifies the value of the tag-format attribute in a grammar. For more information, see SPSEMANTICFORMAT.

Remarks

For more information about SML, see Semantic Markup Language Reference (Microsoft.Speech).