forked from rmcpantoja/FakeYouTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example5.au3
38 lines (38 loc) · 1.2 KB
/
example5.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "include\bassfunctions.au3"
#include "include\fakeYou2.au3"
local $hUrl
_Example()
Func _Example()
_Audio_init_start()
;Local $aVoices = _FakeYouGetVoicesList()
;_ArrayDisplay($aVoices)
;Local $aVoicesCategories = _FakeYouGetVoicesCategoriesList()
;_ArrayDisplay($aVoicesCategories)
Local $sJobToken = _FakeYouGenerateAudio("Hola mundillo.", "TM:jgv6d8br5jdr")
ConsoleWrite("Result of the generated audio: " & $sJobToken & @CRLF)
ConsoleWrite("Waiting for audio complete..." & @CRLF)
$bStatus = _FakeYouWaitForAudioComplete($sJobToken)
if @error then
Switch @error
case 1
ConsoleWriteError("This job has failed")
case 2
ConsoleWriteError("We have retried to process this job, but it has timed out. Please try again later.")
EndSwitch
EndIf
if $bStatus then
Local $sFinalURL = _FakeYouGetAudioURL($sJobToken)
ConsoleWrite("Audio URL: " & $sFinalURL & @CRLF)
$hUrl = _Set_url($sFinalURL)
If @error then
MsgBox(16, "Error", "Unable to load URL.")
_Audio_stop($hUrl)
_Audio_init_stop($hUrl)
Else
_Audio_play($hUrl)
sleep(11000)
EndIF
Else
ConsoleWriteError("An error occurred in this job.")
EndIf
EndFunc ;==>_TestFakeAPI