zackrspv Posted December 17, 2009 Share Posted December 17, 2009 I have a wonderful Jabber/XMPP autoit chat that I wanted to add TTS functionality too. So, this is the method I used. It works awesomely well This is just an example. So in this case, click on the button ('Speak/Queue Text') to make it say 'This is a test #' (the # is automatically increaed everytime you press the button). Click it about oh, i dont know, randomly 8 to 10 times. You'll see that it continues to talk, instead of interrupting the text, and then process each message in order it was received. #include <array.au3> Global $voicequeue Global $voice = ObjCreate("SAPI.SpVoice") If Not IsObj($voice) Then Exit MsgBox(0, "TTS Error", "Could not start SAPI services, please make sure they are installed!") $gui = GUICreate("", 120, 20, -1, -1) $but = GUICtrlCreateButton("Speak/Queue Text", 0, 0, 120, 20) GUISetState() $c = 0 While 1 If UBound($voicequeue) > 0 Then If $voice.Status.RunningState = 1 Then $string = _ArrayPop($voicequeue) $voice.Speak($string, 11) EndIf EndIf $msg = GUIGetMsg() Switch $msg Case - 3 Exit Case $but $c += 1 $string = "This is a test: " & $c If $voice.Status.RunningState = 1 Then $voice.Volume = 100 $voice.Voice = $voice.GetVoices().Item(0) $voice.Rate = 0 $voice.Speak($string, 11) Else If UBound($voicequeue) = 0 Then Dim $voicequeue[1] = [$string] Else _ArrayInsert($voicequeue, 0, $string) EndIf EndIf EndSwitch WEnd -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
Apzo Posted December 18, 2009 Share Posted December 18, 2009 Looks good ! BTW, I'm very interested in you jabber code too Can you post it here, or send it to me ? Thanks ! Apzo. All the pop3 functions.Rsync your files on your USB key (or anywhere else) Link to comment Share on other sites More sharing options...
zackrspv Posted December 18, 2009 Author Share Posted December 18, 2009 Looks good !BTW, I'm very interested in you jabber code too Can you post it here, or send it to me ?Thanks ! Apzo.Heya, I replied to you a bit ago in the previous thread you asked me that in. Here's the link to that: Jabber/XMPPYou will need chilkatsocket dll to connect out, and secure the stream, which makes XMPP happy. It was simple to do, the rest is just message handling xml reading, etc. -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
zackrspv Posted December 18, 2009 Author Share Posted December 18, 2009 Heya, I replied to you a bit ago in the previous thread you asked me that in. Here's the link to that: Jabber/XMPP You will need chilkatsocket dll to connect out, and secure the stream, which makes XMPP happy. It was simple to do, the rest is just message handling xml reading, etc. There is a slight change in how i do the login to the rooms than what i posted previuosly to you. You have to be careful how you send the request to join a password protected room, otherwise jabber will give you an invalid method return. For $i = 0 To UBound($rooms) - 1 ;- process each command below for each room If $rooms[$i][0] = "" Then Else If $rooms[$i][1] <> "" Then $count += 1 $send = '<iq id="' & $codeID & '-' & $count + $i & '" to="' & $rooms[$i][0] & '@' & $cserver & '" type="get"><query xmlns="http://jabber.org/protocol/disco#info"></query></iq>' ConsoleWrite("TX:" & $send & @CRLF) asend($objXMPP, $send & @CRLF) Sleep(100) $data = waitars($objXMPP) If $data = -1 Then ConsoleWrite("Failed to log into room. Name is either in use or banned."&@CRLF) EndIf $count += 1 $send = '<presence id="' & $codeID & '-' & $count + $i & '" to="' & $rooms[$i][0] & '@' & $cserver & '/' & $myjid & '"><x xmlns="http://jabber.org/protocol/muc"><password>' & $rooms[$i][1] & '</password></x></presence>' ConsoleWrite("TX:" & $send & @CRLF) asend($objXMPP, $send & @CRLF) Sleep(100) $data = waitars($objXMPP) If $data = -1 Then ConsoleWrite("Failed to log into room. Name is either in use or banned."&@CRLF) ConsoleWrite("DR2: " & $data & @CRLF) If Not StringInStr($data, "presence") Then $data = waitars($objXMPP) ConsoleWrite("DR2: " & $data & @CRLF) If Not StringInStr($data, "presence") Then ContinueLoop EndIf EndIf Sleep(100) Next The key thing to realize here is that if the room has a password, you MUST QUERY the room first (hence why it does the check if element 1 of the subest is not blank. once you query, y ou can then send your presence to the room. -_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now