This repository was archived by the owner on Feb 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
111 lines (102 loc) · 2.21 KB
/
index.html
File metadata and controls
111 lines (102 loc) · 2.21 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<title>Say</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/dracula/highlightjs/dracula.css"
/>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js"></script>
<style>
* {
margin: 0;
}
body {
font-family: "Roboto", sans-serif;
margin: 2em;
text-align: center;
}
h1 {
font-size: 3em;
}
h1,
h2 {
font-weight: 500;
}
h2 .hljs {
font-weight: 400;
font-size: 1rem;
padding: 0.25em 0.5em;
}
a {
color: #e91e63;
text-decoration: none;
font-weight: 500;
}
pre {
display: inline-block;
text-align: left;
}
.hljs {
font-family: "Roboto Mono", monospace;
border-radius: 8px;
padding: 1em;
font-size: 0.9em;
}
.hljs * {
font-weight: 400 !important;
}
</style>
</head>
<body>
<h1>Say</h1>
<div style="margin: 1em 0"></div>
<h2 style="display: inline-flex; align-items: center">
API for macOS'
<pre
style="margin: 0 0.5em"
><code class="language-plaintext">say</code></pre>
command
</h2>
<div style="margin: 2em 0"></div>
<p>
All voice available:
<br />
<a href="/voices" id="voices"></a>
</p>
<div style="margin: 2em 0"></div>
<p>Example script for Tivoli:</p>
<div style="margin: 0.5em 0"></div>
<pre><code class="language-javascript">function tts(voice, text) {
var sound = SoundCache.getSound(
"https://say.tivolicloud.com/sound.wav?voice=" +
encodeURIComponent(voice) +
"&text=" +
encodeURIComponent(text)
);
function play() {
Audio.playSound(sound, {
position: MyAvatar.position,
volume: 0.5
});
Chat.sendMessage(text, false, false);
}
if (sound.downloaded) {
play();
} else {
sound.ready.connect(play);
}
}
tts("Samantha", "Hi there!");</code></pre>
<script>
document.getElementById("voices").textContent =
window.location.origin + "/voices";
hljs.highlightAll();
</script>
</body>
</html>