Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- #include <_httprequest.au3>
- $text = ''
- $dir = @ScriptDir & '\amthanh.mp3'
- $url=_HttpRequest(3,'https://www.bing.com/tspeak?&format=audio%2Fmp3&language=vi&IG=D2CBB80AA6824D9A91B0A5D1074FC4A1&IID=translator.5034.2&text='&_EncodeURL($text))
- $file=FileOpen($dir,2+16)
- FileWrite($file,$url)
- MsgBox(64,'Thông báo','Thành công :D')
- Func _EncodeURL($sData)
- Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"")
- Local $nChar
- $sData=""
- For $i = 1 To $aData[0]
- $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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement