#How to fix the network error in the speech recognition API.

10 messages · Page 1 of 1 (latest)

south tusk
#

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)
    }```
somber spire
#

Provide more info about the error

austere widget
#

@steady marsh you worked with speech recog
Related: speech recognition doesn't work offline in chrome since the audio is sent to a Web service

alpine compass
#

@south tusk provide more info or mark this resolved, please.

south tusk
#

Hey so sorry went offline

south tusk
alpine compass
#

no, that's not what he said.

south tusk
#

Oh

#

Alright I'll keep digging then and mark this as complete

#

Or resolved my bad