For the following code, it does not work on iOS Safari(iPad Air 2 with iOS 9.x). It works everywhere else (Safari on Mac, Chrome on windows)
When I tried to debug the script below on the iPad's Safari (connected to Mac), it does not give any error. It is just silent. No speech.
Please not that this is the simple script, I created many others, such as setting up the voice etc.Nothing works..There is also a separate problem getting the voices, but I want to see if it works with the default voice first.
P.S. If I do XCode programming, using swift to develop native code on iPad (not in Safari), speech works on the iPad. But my goal is to create a web page using the Speech API
Thanks.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
</head>
<body>
<script>
function Speak() {
speechSynthesis.speak(new SpeechSynthesisUtterance("Hello, this is my voice on a webpage"));
var speech = new SpeechSynthesisUtterance();
speech.text = "Hello";
speech.volume = 1; // 0 to 1
speech.rate = 1; // 0.1 to 9
speech.pitch = 1; // 0 to 2, 1=normal
speech.lang = "en-US";
speechSynthesis.speak(speech);
}
</script>
<a id="trigger_me" onclick="Speak()">Speakme</a>
</body>
</html>