Skip to content

Commit 3f6b766

Browse files
committed
Add SSML example
1 parent 5fa33df commit 3f6b766

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

assets/html/ssml.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
</head>
5+
<body>
6+
7+
<button id="press-to-speak">Press to speak</button>
8+
9+
<script>
10+
var a = `
11+
<speak>
12+
What does the Spanish word <lang xml:lang="es-US">casa</lang> mean in English?
13+
</speak>
14+
`;
15+
16+
var b = `
17+
<speak>
18+
<p>
19+
<s>You have 4 new messages.</s>
20+
<s>The first is from Stephanie Williams and arrived at <break/> 3:45pm.
21+
</s>
22+
<s>
23+
The subject is <prosody rate="-20%">ski trip</prosody>
24+
</s>
25+
</p>
26+
</speak>
27+
`
28+
29+
var utterThis = new SpeechSynthesisUtterance(a);
30+
// utterThis.voice = window.speechSynthesis.getVoices()[0];
31+
document.getElementById("press-to-speak").addEventListener("click", () => {
32+
window.speechSynthesis.speak(utterThis);
33+
});
34+
35+
</script>
36+
</body>
37+
</html>
38+

0 commit comments

Comments
 (0)