ricky0123 / vad

Voice activity detector (VAD) for the browser with a simple API
https://www.vad.ricky0123.com
Other
778 stars 121 forks source link

not working in mobile browser #37

Open topcmm opened 1 year ago

topcmm commented 1 year ago

it's working in pc, but not working in mobile browser

ricky0123 commented 9 months ago

Hi @topcmm which mobile browser? Safari?

MediGenie commented 7 months ago

so almost all mobile browsers dont allow automatic audio streaming, hence it would be nice if there are nice libraries so we can develop it for react native....there is one for flutter. https://github.com/char5742/flutter_silero_vad

Rabithua commented 3 months ago

ios Safari cannot run properly, https://www.vad.ricky0123.com/ keeps loading.

Rabithua commented 3 months ago

I took a look and it seems that the onnx and wasm files have not been loaded yet (but there is no error in vad). How can I get the loading information of these two files, or load them before the app runs?

Rabithua commented 3 months ago

I took a look and it seems that the onnx and wasm files have not been loaded yet (but there is no error in vad). How can I get the loading information of these two files, or load them before the app runs?

I know what to do, I need to judge vad. loading

murat-aksoy commented 2 weeks ago

Your demo site https://www.vad.ricky0123.com is working in mobile browsers like Chrome or Safari. I created a sample page using the code below

<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/ort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.7/dist/bundle.min.js"></script>
<script>
  async function main() {
    const myvad = await vad.MicVAD.new({
      onSpeechStart: () => {
        console.log("Speech start detected")
      },
      onSpeechEnd: (audio) => {
        // do something with `audio` (Float32Array of audio samples at sample rate 16000)...
      }
    })
    myvad.start()
  }
  main()
</script>

But It gives me this error on IOS Chrome or Safari browsers: Error: no available backend found. ERR: [wasm] RangeError: Out of memory, [cpu] Error: previous call to 'initWasm()' failed.

What could be the problem?