本帖最后由 3mile 于 2011-9-11 10:42 编辑
#include <array.au3>
$sp = ObjCreate("SAPI.SPVoice")
Global $getvoice = $sp.GetVoices()
Global $who[1]
For $VoiceNames In $getvoice
ReDim $who[UBound($who) + 1]
$who[UBound($who) - 1] = $VoiceNames.getdescription()
Next
_ArrayDelete($who,0)
$sp.volume = 100
$sp.Rate = 3
While True
Sleep(100)
$str = ClipGet()
If StringLen($str) > 0 Then
For $i = 0 To UBound($who) - 1
MsgBox(0, $who[$i], '"NAME=' & $who[$i] & '"')
$sp.Voice = $sp.GetVoices().Item($i)
$sp.speak($str)
Next
ClipPut("")
EndIf
WEnd
|