-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtts.php
35 lines (29 loc) · 903 Bytes
/
tts.php
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
<?php
$url = 'http://www.acapela-group.com/demo-tts/DemoHTML5Form_V2.php';
$text = 'Hello, world!';
$sonid = 'sonid9';
$voice = 'Heather';
if ($_GET['s']) $sonid = $_GET['s'];
if ($_GET['v']) $voice = $_GET['v'];
if ($_GET['q']) $text = $_GET['q'];
$data =
array(
'MyLanguages' => $sonid,
'MySelectedVoice' => $voice,
'MyTextForTTS' => $text,
'SendToVaaS' =>'');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$hookp = "var myPhpVar = '";
$fuck = substr(strstr($result,$hookp),strlen($hookp));
$rv = substr($fuck,0,strpos($fuck,"'"));
echo '{ "success": true, "data":"'.$rv.'" }';
?>