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

[Solved!] Removing Polyfill if the language is not supported #145

Closed
YoussefZidan opened this issue Aug 30, 2022 · 2 comments
Closed

[Solved!] Removing Polyfill if the language is not supported #145

YoussefZidan opened this issue Aug 30, 2022 · 2 comments

Comments

@YoussefZidan
Copy link

To support more than just Chrome, I'm using "@speechly/speech-recognition-polyfill."

nonetheless, the Arabic language is not supported as a result.

So, my goal is to only apply the polyfill if the language is "en," otherwise, I want to delete it.

something like this:

  useEffect(() => {
    if (lang !== "ar") {
      const SpeechlySpeechRecognition = createSpeechlySpeechRecognition(speechlyId);
      SpeechRecognition.applyPolyfill(SpeechlySpeechRecognition);
    } else {
      SpeechRecognition.removePolyfill();  // <=== is there a function to stop or removes the polyfill ??
    }
  }, [lang]);
@JamesBrill
Copy link
Owner

@YoussefZidan Thanks for raising this - this seems like a legitimate use case to me. That feature now exists in 3.10.0 - let me know how it works for you.

@YoussefZidan
Copy link
Author

@YoussefZidan Thanks for raising this - this seems like a legitimate use case to me. That feature now exists in 3.10.0 - let me know how it works for you.

Gerat!

Thanks alot!

It's working fine ^^

@YoussefZidan YoussefZidan changed the title Removing Polyfill if the language is not supported [Solved!] Removing Polyfill if the language is not supported Oct 20, 2022
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

2 participants