Speech Automation 5.1
A command button called Command1
Two text boxes called Text1 and Text2
Interface: ISpeechVoiceStatus
PhonemeId Property
The PhonemeId property retrieves the ID of the current phoneme being spoken by the voice.
Syntax
Set: | (This property is read-only) |
Get: | Integer = ISpeechVoiceStatus.PhonemeId |
Parts
- ISpeechVoiceStatus
- The owning object.
- Integer
-
Set: (This property is read-only)
Get: An Integer variable returning the Phoneme ID.
Example
The following Visual Basic form code demonstrates the use of the PhonemeId property of an ISpeechVoiceStatus object. To run this code, create a form with the following controls:
Paste this code into the Declarations section of the form.
The Form_Load procedure creates a voice object and places a sentence in the text box. The Command1_Click procedure speaks the contents of the text box asynchronously, and loops until the voice has finished speaking. Inside the loop, the code checks PhonemeId property periodically and displays it in Text2.
Option Explicit
Private V As SpeechLib.SpVoice
Private Sub Command1_Click()
Dim ii As Integer
Text2.Text = ""
V.Speak Text1.Text, SVSFlagsAsync
Do
For ii = 0 To 20000
DoEvents
Next ii
Text2.Text = Text2.Text & V.Status.PhonemeId & " "
Loop While V.Status.RunningState = SRSEIsSpeaking
End Sub
Private Sub Form_Load()
Set V = New SpVoice
Text1.Text = "way, we, why, woe, woo."
Text2.Text = ""
End Sub