aofdev/vue-pwa-speech

stopRecording is called immediately

vesper8 opened this issue · 1 comments

This is a pretty weird thing that was happening to me.. I was getting this error:

ERROR:TypeError: Cannot read property '0' of undefined

After doing a bit of debugging I could see that stopRecording was being called immediately.. the timeout was being ignored completely.. btw.. why such a huge timeout of 58000 anyway?

This was not working:

setTimeout(this.stopRecording(), 58000)

I changed it to

        setTimeout(() => {
          this.stopRecording()
        }, 1500);

And then it started working.. everything else works fine :) thanks for the demo!

I don't like that there's a fixed timeout though.. is there a way to get it to stop listening after a small amount of silence is detected?

#5 Fixed by @Zeani