-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (60 loc) · 1.09 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TTS</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
function sendTTS()
{
var tones = $("#tones").is(":checked");
var text = $("#text").val();
var data =
{
tones: (tones ? 1 : 0),
text: text
}
jQuery.post("tts.php", data, ttsSuccess);
}
function ttsSuccess(data, textStatus, jqXHR)
{
$("#resultDiv > pre").text(data);
}
</script>
<style type="text/css">
body
{
background-color: #fff;
color: #000;
font-family: arial, helvetica, sans-serif;
}
div.border
{
border: 1px solid #ccc;
margin-top: 15px;
padding: 4px;
background-color: #eee;
display: inline-block;
width: 300px;
}
div
{
margin-bottom: 5px;
}
</style>
</head>
<div>
<input type="checkbox" id="tones"/> <label for='tones'>Play Tones?</label>
</div>
<div>
<label for='text'>Text: </label> <input type="text" id="text">
</div>
<div>
<button onclick='sendTTS();'>Send</button>
</div>
<div id="resultDiv" class="border">
<pre>
</pre>
</div>
</body>
</html>