Forum Discussion
Web Speech API not working in Edge v. 147
Also in Austria it is not working.
Also in Greece it is not working.
the following script works perfect on Chrome but returns network error on Edge
<!DOCTYPE html>
<html lang="el">
<head>
<meta charset="UTF-8">
<title>Edge Speech Test</title>
</head>
<body>
<h2>Speech Recognition Test</h2>
<button id="start">Start</button>
<button id="startTwice">Start Twice (test error)</button>
<pre id="log"></pre>
<script>
const SR = window.SpeechRecognition || window.webkitSpeechRecognition;
let recognition = null;
function log(msg) {
document.getElementById("log").textContent += msg + "\n";
console.log(msg);
}
function createRecognition() {
const r = new SR();
r.lang = "el-GR";
r.continuous = false;
r.interimResults = false;
r.onstart = () => log("✅ STARTED");
r.onresult = (e) => {
const t = e.results[0][0].transcript;
log("✅ RESULT: " + t);
r.stop();
};
r.onerror = (e) => log("❌ ERROR: " + e.error);
r.onend = () => log("🔚 ENDED");
return r;
}
// ✅ Normal start (like working case)
document.getElementById("start").onclick = () => {
log("---- NORMAL START ----");
recognition = createRecognition();
recognition.start();
};
// 🚨 Double start test (simulate your app)
document.getElementById("startTwice").onclick = () => {
log("---- DOUBLE START ----");
recognition = createRecognition();
recognition.start();
// Δεύτερο start σχεδόν αμέσως
setTimeout(() => {
try {
recognition.start();
log("⚠ δεύτερο start()");
} catch(e) {
log("caught error: " + e.message);
}
}, 50);
};
</script>
</body>
</html>