'引用 Microsoft Speech Object Library
Dim sph As SpVoice
Private Sub Command1_Click()
Set sph.Voice = sph.GetVoices.Item(Me.List1.ListIndex)
sph.Speak "是的 yes"
End Sub
Private Sub Form_Load()
Dim t As SpObjectToken
Set sph = New SpVoice
For Each t In sph.GetVoices
Me.List1.AddItem t.GetDescription
Next
End Sub
The Microsoft Speech SDK 5.1 adds Automation support to the features of the previous version of the Speech SDK. You can now use the Win32 Speech API (SAPI) to develop speech applications with Visual Basic ®, ECMAScript and other Automation languages. The SDK also includes freely distributable text-to-speech (TTS) engines (in U.S. English and Simplified Chinese) and speech recognition (SR) engines (in U.S. English, Simplified Chinese, and Japanese).