Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
ISpEnginePronunciation::GetPronunciations
ISpEnginePronunciation::GetPronunciations returns all of the pronunciations the engine knows about for a given word.
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT GetPronunciations(</strong> <strong> LPCWSTR</strong> *<em>pszWord</em>, <strong> LPCWSTR</strong> <em>pszLeftContext</em>, <strong> LPCWSTR</strong> <em>pszRightContext</em>, <strong> LANGID</strong> <em>LangID</em>, <strong> <a runat="server" href="jj127892(v=msdn.10).md">SPWORDPRONUNCIATIONLIST</a></strong> *<em>pEnginePronunciationList</em> <strong>);</strong> </pre>
Parameters
- pszWord
[in] The word or term for which a pronunciation is desired (for example, "record"). This is case sensitive. - pszLeftContext
[in] The left portion of a sentence or phrase in which pszWord is used. Can be NULL. - pszRightContext
[in] The right portion of a sentence or phrase in which pszWord is used. Can be NULL. - LangID
[in] The ID of the language. This parameter is useful if an engine supports multiple languages. To use the engine's default language, set the ID to 0. - pEnginePronunciationList
[out] Returns a list of pronunciations. The application must allocate the SPWORDPRONUNCIATIONLIST structure that pEnginePronunciationList points to. The engine will allocate the space for the pronunciation list itself and provide a pointer to it in pEnginePronunciationList->pvBuffer. The application is responsible for calling CoTaskMemFree() on pEnginePronunciationList->pvBuffer to release the allocation.
Return Values
Value | Description |
---|---|
S_OK | Function completed successfully. |
S_NEEDSNORMALIZATION | Indicates that the word in pszWord needs to be normalized before pronunciations can be provided. All values in pEnginePronunciationList will be set to 0. |
S_NEEDSWORDBREAK | Indicates that pszWord contains multiple words. The application should call Normalize to break it into individual words and then call GetPronunciation again with the specific word of interest. |
S_NOTSUPPORTED | Indicates that the engine will not provide pronunciation for the given input. All values in pEnginePronunciationList will be set to 0. |
Remarks
Specifying pszLeftContext and pszRightContext may improve the accuracy of the normalization result, provided the speech engine supports these parameters. The pszLeftContext and pszRightContext parameters are always case sensitive and either of them can be set to NULL, in which case the engine ignores the parameter. In addition, the engine may ignore any context string.