Releases: speechly/speech-recognition-polyfill
Close microphone on stop
Speechly Browser Client v2
This release upgrades the Speechly Browser Client to major version 2.
onerror callback
As per this issue, it wasn't clear how to handle the case where the user denies microphone access. This release addresses a gap in both the documentation in the README and in the way errors are surfaced to the consumer, moving from a non-standard approach to one compliant with the W3C spec.
This release introduces support for the onerror callback as a means of handling errors.
A common error case is when the user chooses not to give permission for the web app to access the microphone. This, and any other error emitted by this polyfill, can be handled via the onerror callback. In such cases, it's advised that you render some fallback UI as these errors will usually mean that voice-driven features will not work and should be disabled:
import { MicrophoneNotAllowedError } from '@speechly/speech-recognition-polyfill';
...
speechRecognition.onerror = (event) => {
if (event === MicrophoneNotAllowedError) {
// Microphone permission denied - show some fallback UI
} else {
// Unable to start transcribing - show some fallback UI
}
};
First major release
Basic polyfill for SpeechRecognition that implements the following fields and methods:
- continuous
- interimResults
- onresult
- onend
- start
- stop
- abort
hasBrowserSupport check
What
Adds a static property hasBrowserSupport to the class produced by createSpeechlySpeechRecognition that is false if the MediaDevices or AudioContext APIs are not supported by the browser (both of these are required by the underlying Speechly browser client).
Why
IE11 and some old browsers don't support the APIs needed by this polyfill. Previously, the polyfill would throw errors when being created on these browsers. Now, consumers have a means of checking for browser support before using the polyfill, enabling them to gracefully apply fallback behaviour.
Test publish
v0.0.6 Enable public publishing
Test publish
v0.0.5 Tweak README examples