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

Receive "not supported" error in Safari #216

Closed
Rextyj opened this issue Jul 22, 2020 · 1 comment
Closed

Receive "not supported" error in Safari #216

Rextyj opened this issue Jul 22, 2020 · 1 comment

Comments

@Rextyj
Copy link

Rextyj commented Jul 22, 2020

The SDK works fine in Chrome (not iOS Chrome), but calling startContinuousRecognitionAsync in Safari immediately throws this error:

Browser does not support Web Audio API (AudioContext is not available).

After checking out the source code, it appears the error is throwing at this place:

if (typeof (AudioContext) === "undefined") {
      throw new Error("Browser does not support Web Audio API (AudioContext is not available)."); 
}

As far as I know, Safari does support AudioContext but it requires 'webkit' prefix.
Is there a technical reason why webkitAudioContext is not checked and used for Safari?

@Rextyj Rextyj changed the title Receive not supported error in Safari Receive "not supported" error in Safari Jul 22, 2020
@Rextyj
Copy link
Author

Rextyj commented Jul 23, 2020

Looks like there is an active PR #213 that is going to address this issue.

Meanwhile, I added the following to index.html temporarily:

<script>
      var AudioContext = window.AudioContext 
       || window.webkitAudioContext 
       || false;
</script>

Will close this issue.

@Rextyj Rextyj closed this as completed Jul 23, 2020
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

1 participant