Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAD-WEB error on safari : SIMD not supported in the current environment #157

Open
Serotoninene opened this issue Nov 18, 2024 · 6 comments

Comments

@Serotoninene
Copy link

Serotoninene commented Nov 18, 2024

Description

I'm using the MicVAD library for voice activity detection, and it works well in Chrome. However, when I try to run it in Safari, I get an error indicating that "SIMD is not supported in the current environment".

Complete error : "no available backend found. ERR: [wasm] Error: WebAssembly SIMD is not supported in the current environment., [cpu] Error: previous call to 'initWasm()' failed"

Code Snippet

Here’s a simplified version of how I am initializing MicVAD:

 this.myvad = await vad.MicVAD.new({
    positiveSpeechThreshold: 0.9,
    onFrameProcessed: (frame) => {
      if (!this.micAccessConfirmed) {
        this.micAccessConfirmed = true;
        this.connected();
      }
    },
    onSpeechStart: () => {
      if (!this.isConnected) return;
      this.toListening();
    },
    onSpeechEnd: (audio) => {
      this.isListening = false;
      this.toProcessing(audio);
    },
    redemptionFrames: 10 * 1.4,
  });

I would like to know if there is a way to use MicVAD or a fallback approach when SIMD is not supported by the browser.

Environment

  • vad-web version : @0.0.7
@ricky0123
Copy link
Owner

Hi @Serotoninene can you share what version of onnxruntime-web you are using?

@Serotoninene
Copy link
Author

Serotoninene commented Dec 2, 2024

Hi @ricky0123 ! I'm not sure, I followed your doc and used those scripts :

<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@ricky0123/[email protected]/dist/bundle.min.js"></script>

After doing some research, I found out that SIMD wasn't supported in Safari prior to version 16. Is there any way to make it work on older versions, or is it simply not feasible?

@ricky0123
Copy link
Owner

Hi @Serotoninene can you try using an older version of onnxruntime-web? You can try these script tags

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ort.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@ricky0123/[email protected]/dist/bundle.min.js"></script>

@Payam09
Copy link

Payam09 commented Dec 16, 2024

I also encountered the same problem. I think it may be caused by the problem described in: 15644. I tried to follow the possible solutions mentioned there, but I couldn't complete it, so I'm not sure if it works. I want to know if Ricky has a good way to solve or avoid it.

My usage scenario is in the ionic capacitor project, and my js part of the code runs in the webview, so I am also affected by the iOS webviewb version and defects

@ricky0123
Copy link
Owner

Hi all, can you test using the most recent version of the library?

@Payam09
Copy link

Payam09 commented Dec 22, 2024

Hi all, can you test using the most recent version of the library?

I have upgraded to the latest version, which solves the problem that versions below iOS 16.5 cannot be used. Thank you very much for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants