ISpeechLexiconPronunciation PhoneIds Property

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechLexiconPronunciation

PhoneIds Property


The PhoneIds property returns the pronunciation of a word as a Variant array of numeric phone ids.

Pronunciations represented in PhoneIds can be converted to phones with the IdToPhone method of theSpPhoneConverter object.

Syntax

Set: (This property is read-only)
Get: Variant = ISpeechLexiconPronunciation.PhoneIds

Parts

ISpeechLexiconPronunciation
The owning object.
Variant
Set: (This property is read-only)
Get: A Variant variable returning the value of the property.

Example

The following code snippet creates a lexicon, adds a pronunciation to it, then gets the pronunciation object, and formats the values of the PhoneIds as a string. The resulting string is " 46 12 33."

Dim objLEX As SpeechLib.SpLexicon
Dim objPRO As SpeechLib.ISpeechLexiconPronunciation
Dim colPRO As SpeechLib.ISpeechLexiconPronunciations
 
Set objLEX = New SpeechLib.SpLexicon

Call objLEX.AddPronunciation("one", 1033, SPSNoun, "w ah n")

'Get item(0) of the pronunciations collection
Set colPRO = objLEX.GetPronunciations("one", 1033)
Set objPRO = colPRO(0)

Dim varPhoneIds As Variant  'A Variant array of numeric values
Dim strOut As String        'Display the PhoneId values

varPhoneIds = objPRO.PhoneIds
strOut = Str(varPhoneIds(0)) & Str(varPhoneIds(1)) & Str(varPhoneIds(2))