Returns the ASR Engine's phonetic pronunciation for a list of words as a list of raw phonemes.
- static int GetPhoneticPronunciation(const char* words, const char* lang, int idx, char* pronunication, int len)
A list of one or more words, separated by spaces.
The language whose dictionary should be checked. This needs to be a language identifier string (Ex: "AmericanEnglish", "ColombianSpanish") that corresponds to an acoustic model. See Language Identifier for the list of supported languages.
The index to the specific pronunciation you would like returned. Many words and phrases have multiple possible pronunciations; this specifies which pronunciation you would like returned. This value can be in the range [0, (GetPhoneticPronunciationCount() - 1)] with the same words and lang passed to GetPhoneticPronunciationCount. The first item in the index is number 0.
The pointer to a char buffer to place the pronunciation results in.
The size of the pronunciation buffer.
The call succeeded. The required pronunciation was copied into pronunciation.
idx is invalid. Must be in the range [0, (GetPhoneticPronunciationCount() - 1)] for the same words and lang.
The operation failed because one or both the inputs were NULLs.
The sending of the request to the ASR server failed.
Either the requested language is not available or lang is not a valid language identifier.
The operation failed because no ASR server was available.
An exception occurred while processing the request.
After calling the function, the pronunciation buffer you specify will contain a list of space-separated phonemes that give the phonetic pronunciation of the words. Multiple words will be joined by ampersands (the & character) in the pronunciation.
If a grammar word is not in the ASR Engine's dictionary, it falls back to its internal phonetic speller to try and best determine how a word should be pronounced. Often, especially in dealing with words not native to the specified language (e.g. foreign names), it is helpful to supply phonetic spellings.
See Using Phonetic Spellings for more information about phonemes and phonetic spellings.