hi,
Hans Zethofer hat geschrieben:
aber auf Deutsch ist es teileweise sehr unverständlich!
Gibt's da vielleicht noch andere Möglichkeiten?
Hast du es auf "deutsch" gestellt oder meinst du "deutsch" von "Sam"
vorgelesen ? Theoretisch kann man die "Stimme" wechseln und die
Sprache wählen aber genau das scheint das activeX Problem zu sein
da Xbase++ ja nur "IDispatch" kann.
Code: Alles auswählen
// will NOT give a Array, it will be a Object of "ISpObjectToken"
aVoice := oApp:GetVoices("Name=Microsoft mary", "Language=407")
aVoice := oApp:callMethod("GetVoices","Name=Microsoft mary","Language=407")
aVoice := oApp:invoke("GetVoices",0,DISPATCH_METHOD,"Name=Microsoft mary", "Language=407")
// ERROR ... "SetVoice"
oApp:SetVoice("Name=Microsoft mary", "Language=407")
oApp:callMethod("SetVoice",aVoice[1])
oApp:invoke("SetVoice",2,DISPATCH_METHOD,"Name=Microsoft mary","Language=407")
und hier der VB Code
Code: Alles auswählen
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error
handler
_TalkOBJ('This is auto it beta speaking.', 3)
_TalkOBJ('This is auto it beta speaking.', 3)
_TalkOBJ('This is auto it beta speaking.', 3)
;voice params:
;
;1 - Microsoft Mary
;2 - Microsoft Mike
;3 - Microsoft Sam
Func _TalkOBJ($s_text, $s_voice = 3)
Local $o_speech = ObjCreate ("SAPI.SpVoice")
Select
Case $s_voice == 1
$o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Mary","Language=409").Item(0)
Case $s_voice == 2
$o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Mike","Language=409").Item(0)
Case $s_voice == 3
$o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Sam" ,"Language=409").Item(0)
EndSelect
$o_speech.Speak ($s_text)
$o_speech = ""
EndFunc ;==>_TalkOBJ
; This is my custom error handler
Func MyErrFunc()
$HexNumber=hex($oMyError.number,8)
Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
"Number is: " & $HexNumber & @CRLF & _
"Windescription is: " & $oMyError.windescription )
SetError(1); something to check for when this function returns