Speech Automation 5.1
A label called Label1
Object: SpPhoneConverter
IdToPhone Method
The IdToPhone method converts an array of phoneme IDs to a string of phoneme symbols.
If the IdToPhone method is called before setting the SpPhoneConverter's LanguageId property, an SPERR_UNINITIALIZED error will occur.
SpPhoneConverter.IdToPhone(
IdArray As Variant
) As String
Parameters
- IdArray
- An array of phoneme IDs or a single phoneme ID.
Return Value
A String variable.
Example
The following Visual Basic form code demonstrates the use of the IdToPhone. The application assigns values to an array and then displays the resulting phoneme string.
To run this code, create a form with the following control:
Paste this code into the Declarations section of the form.
Dim objPhoneConverter As New SpPhoneConverter
Private Sub Form_Load()
' US English
objPhoneConverter.LanguageId = 1033
' Get the phoneme symbols of the phoneme id 1
objPhoneConverter.IdToPhone (1)
Dim ids(2) As Integer
ids(0) = 1
ids(1) = 2
ids(2) = 3
' Get a string of phoneme symbols for the specified phoneme ids, separated by space.
Label1.Caption = """" & objPhoneConverter.IdToPhone(ids) & """"
End Sub