LVSpeechPort::GetPhoneticPronunciation

Returns the ASR Engine's phonetic pronunciation for a list of words as a list of raw phonemes.

Function

Parameters

words

A list of one or more words, separated by spaces.

lang

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.

idx

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.

pronunciation

The pointer to a char buffer to place the pronunciation results in.

len

The size of the pronunciation buffer.

Return Values

LV_SUCCESS

The call succeeded. The required pronunciation was copied into pronunciation.

LV_INVALID_INDEX

idx is invalid. Must be in the range [0, (GetPhoneticPronunciationCount() - 1)] for the same words and lang.

LV_FAILURE

The operation failed because one or both the inputs were NULLs.

LV_TIME_OUT

The sending of the request to the ASR server failed.

LV_INVALID_DICTIONARY_LANGUAGE

Either the requested language is not available or lang is not a valid language identifier.

LV_NO_SERVER_AVAILABLE

The operation failed because no ASR server was available.

LV_EXCEPTION

An exception occured while processing the request.

Remarks

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.

See Also

© 2012 LumenVox LLC. All rights reserved.