-
Posts
34,503 -
Joined
-
Days Won
318
Jos last won the day on October 9
Jos had the most liked content!
About Jos
Profile Information
-
Member Title
Je maintiendrai
Jos's Achievements
-
donnyh13 reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
@donnyh13, Still feels like some race condition, so I have added some logic that the "IPC ping" needs to fail 3 times now before it is assumed that the other process must have ended. So the watcher task gives the other process(es) running the userscript a bit more time to handle the userscript ending. (I hope) Could you please test with this version of AutoIt3Wrapper.au3 to check if you still can make things fail? Thanks
-
What about this version?: #include <Date.au3> #include <WinAPIDiag.au3> #include <Curl.au3> Test() Func Test() ;Set up and execute cURL request $hCurl = Curl_Easy_Init() If Not $hCurl Then Return MsgBox($MB_ICONERROR, "Error", "Curl_Easy_Init() failed.") $url = "https://speechgen.io/index.php?r=api/text" ; $Text = "Привіт шановний" $data = 'token=-redacted-' & _ '&email=' & _URIEncode('email@gmail.com') & _ '&voice=Ostap' & _ '&format=mp3' & _ '&speed=0.8' & _ '&emotion=good' & _ '&pause_sentence=300' & _ '&pause_paragraph=400' & _ '&bitrate=48000' & _ '&text=' & _URIEncode($Text) ConsoleWrite("Data: " & $data & @CRLF) $CURLOPT_RETURNTRANSFER = 19913 Curl_Easy_Setopt($hCurl, $CURLOPT_RETURNTRANSFER, 1) ; Curl_Easy_Setopt($hCurl, $CURLOPT_URL, $url) ; Curl_Easy_Setopt($hCurl, $CURLOPT_HEADER, False) ; Curl_Easy_Setopt($hCurl, $CURLOPT_SSL_VERIFYHOST, False) ; Curl_Easy_Setopt($hCurl, $CURLOPT_POST, 1) ; Curl_Easy_Setopt($hCurl, $CURLOPT_POSTFIELDS, $data) ;Get response code and response $iRespCode = Curl_Easy_Perform($hCurl) If $iRespCode <> $CURLE_OK Then Return ConsoleWrite("Status Message: " & Curl_Easy_StrError($iRespCode) & @LF) $sResponse = BinaryToString(Curl_Data_Get($hCurl)) ;Clean up curl environment Curl_Easy_Cleanup($hCurl) Curl_Data_Cleanup($hCurl) ;Display response ConsoleWrite($sResponse & @CRLF) EndFunc ;==>Test Func _URIEncode($sData) ; Prog@ndy Local $aData = StringSplit(BinaryToString(StringToBinary($sData, 4), 1), "") Local $nChar $sData = "" For $i = 1 To $aData[0] ; ConsoleWrite($aData[$i] & @CRLF) $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar, 2) EndSwitch Next Return $sData EndFunc ;==>_URIEncode I took the Example of a short text voiceover in PHP variant 1 from their WebSite and converted that to Autoit3.
-
Did you also fix this line?: $data = '{"Token":"{redacted}","email":"email@gmail.com","voice":"Ostap","format":"mp3","speed":"0.8","emotion":"good", _ "pause_sentence":"300","pause_paragraph":"400","bitrate":"48000",' which should be: $data = '{"Token":"{redacted}","email":"email@gmail.com","voice":"Ostap","format":"mp3","speed":"0.8","emotion":"good",' & _ '"pause_sentence":"300","pause_paragraph":"400","bitrate":"48000",' Try something like this and see what that does: #include <Date.au3> #include <WinAPIDiag.au3> #include <Curl\Curl.au3> Test() Func Test() ;Create an array of request headers Local $arrHeaders = Curl_Slist_Append(0, "Accept: application/json") $arrHeaders = Curl_Slist_Append($arrHeaders, "Content-Type: application/json") ;Set up and execute cURL request $hCurl = Curl_Easy_Init() If Not $hCurl Then Return MsgBox($MB_ICONERROR, "Error", "Curl_Easy_Init() failed.") Curl_Easy_Setopt($hCurl, $CURLOPT_URL, "https://speechgen.io/index.php?r=api/text") Curl_Easy_Setopt($hCurl, $CURLOPT_HTTPHEADER, $arrHeaders) Curl_Easy_Setopt($hCurl, $CURLOPT_USERAGENT, "AutoIt/cURL") Curl_Easy_Setopt($hCurl, $CURLOPT_VERBOSE, 1) Curl_Easy_Setopt($hCurl, $CURLOPT_SSL_VERIFYPEER, 0) Curl_Easy_Setopt($hCurl, $CURLOPT_READFUNCTION, Curl_DataReadCallback()) ;Curl_Easy_Setopt($hCurl, $CURLOPT_CUSTOMREQUEST, "PUT") ;Curl_Easy_Setopt($hCurl, $CURLOPT_UPLOAD, 1) $data = '{"Token":"-redacted-","email":"email@gmail.com","voice":"Ostap","format":"mp3","speed":"0.8","emotion":"good",' & _ '"pause_sentence":"300","pause_paragraph":"400","bitrate":"48000",' & _ '"text":"Heo світ"}' ConsoleWrite(@crlf & $data & @crlf & @crlf) Curl_Easy_Setopt($hCurl, $CURLOPT_POSTFIELDS, $data) ;Get response code and response $iRespCode = Curl_Easy_Perform($hCurl) If $iRespCode <> $CURLE_OK Then Return ConsoleWrite("Status Message: " & Curl_Easy_StrError($iRespCode) & @LF) $sResponse = BinaryToString(Curl_Data_Get($hCurl)) ;Clean up curl environment Curl_Easy_Cleanup($hCurl) Curl_Data_Cleanup($hCurl) ;Display response ConsoleWrite($sResponse & @CRLF) EndFunc ;==>Test
-
Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team
-
Davidyese reacted to a post in a topic: StringRegExpReplace result
-
Something like this? StringRegExpReplace($Var007beta, '(?s).*?Wired\s+(.*)\s+released.*$', "$1")
-
donnyh13 reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
Jos reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
donnyh13 reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
Jos reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
mLipok reacted to a post in a topic: Forum login requires now the use of your Email address
-
mLipok reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
argumentum reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
SOLVE-SMART reacted to a post in a topic: BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
-
...and why would they? Please read what EXIF stands for and it probably will make sense!