Hello everyone!
I am making a simple speech-to-text api, and am using the generic SpeechRecognition api for it.
However, when I start recording, it starts. But then instantly I get an error : network.
I googled it and looked through a couple different forums, but could not get an ideal solution.
If anyone can help me out, it will be greatly appreciated.
Below is my code.
let SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition,
recognition
try {
recognition = new SpeechRecognition();
recognition.interemResults = true
recognition.start()
recognition.onresult = (event)=> {
const speech = event.result[0][0].transcript
SpeechTextInput.value = speech
}
} catch (error) {
console.warn(error)
}
recognition.onerror = (event) => {
alert("Error : "+event.error)
}```