Const SVSFlagsAsync = 1
const SVSFPurgeBeforeSpeak = 2
Dim Speech
Dim FSO
CreateObjects
Main
DestroyObjects
Quit
Sub Main
Dim sText
sText="在其数据访问引擎中内置了乐观锁实现,如果不用考虑外部系统对数"
If sText <> "" Then
SpeakText sText
End If
End Sub
Sub SpeakText(sText)
On Error Resume Next
Speech.Speak sText, SVSFlagsAsync + SVSFPurgeBeforeSpeak
Do
Sleep 100
Loop Until Speech.WaitUntilDone(10)
End Sub
Sub StopSpeaking()
On Error Resume Next
Speech.Speak vbNullString, SVSFPurgeBeforeSpeak
Set Speech = Nothing
End Sub
Sub CreateObjects
Set V = CreateObject("SAPI.SpVoice")
'V.Voice = V.GetVoices().Item(0)
Set FSO = CreateObject("Scripting.FileSystemObject")
End Sub
Sub DestroyObjects
Set Speech = Nothing
Set FSO = Nothing
End Sub
Sub Sleep(nTimeout)
WScript.Sleep nTimeout
End Sub
Sub Quit
WScript.Quit
End Sub