Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- #include <_httpRequest.au3>
- #include <ButtonConstants.au3>
- #include <ComboConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 553, 400, 628, 173)
- $Group1 = GUICtrlCreateGroup("Text", 0, 0, 385, 393)
- $Edit1 = GUICtrlCreateEdit("Edit1", 8, 16, 369, 369)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group2 = GUICtrlCreateGroup("Setting", 392, 0, 153, 153)
- $Label1 = GUICtrlCreateLabel("Language :", 400, 16, 58, 17)
- $Combo1 = GUICtrlCreateCombo("English", 464, 16, 73, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
- GUICtrlSetData($Combo1, "Vietnamese|China|ThaiLans")
- $Label2 = GUICtrlCreateLabel("Server :", 400, 48, 41, 17)
- $Combo2 = GUICtrlCreateCombo("Bing", 464, 48, 73, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Button1 = GUICtrlCreateButton("Download", 392, 160, 155, 41)
- $Button2 = GUICtrlCreateButton("Play", 392, 208, 155, 49)
- $Group3 = GUICtrlCreateGroup("About", 392, 264, 153, 129)
- $Label3 = GUICtrlCreateLabel("Dev : ", 400, 280, 33, 17)
- $Label4 = GUICtrlCreateLabel("Nguyen Hoang Vu", 432, 280, 92, 17)
- $Label5 = GUICtrlCreateLabel("Dev : ", 400, 312, 33, 17)
- $Label6 = GUICtrlCreateLabel("FB.com/HoangVu2000", 432, 312, 114, 17)
- $Label7 = GUICtrlCreateLabel("Dev : ", 400, 344, 33, 17)
- $Label8 = GUICtrlCreateLabel("No Youtube", 432, 344, 61, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Global $path = @ScriptDir & '\audio.mp3'
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- FileDelete($path)
- _Download_mp3(GUICtrlRead($Edit1),GUICtrlRead($Combo1))
- Case $Button2
- SoundPlay($path,0)
- EndSwitch
- WEnd
- Func _Download_mp3($text,$ngonngu, $file = "audio.mp3")
- $ngonngu = ($ngonngu = "Vietnamese") ? "vi" : $ngonngu
- $ngonngu = ($ngonngu = "English") ? "en" : $ngonngu
- $ngonngu = ($ngonngu = "China") ? "zh" : $ngonngu
- $ngonngu = ($ngonngu = "ThaiLans") ? "th" : $ngonngu
- Local $link = 'https://www.bing.com/tspeak?&format=audio%2Fmp3&language=' & $ngonngu & '&IG=DA8194C682414AE998883AAC020AAE8D&IID=translator.5036.1&text=' & _URIEncode($text)
- Local $rq = _HttpRequest(3,$link)
- $path = @ScriptDir & '\' & $file
- FileWrite(@ScriptDir & '\' & $file,$rq)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement