@speechly/speech-recognition-polyfill
A polyfill (a "ponyfill" to be more precise) for the SpeechRecognition API that uses Speechly to implement the transcription functionality
Remarks
The implementation of the SpeechRecognition spec is incomplete, but should enable the majority of use cases
- SpeechRecognition
- SpeechRecognitionAlternative
- SpeechRecognitionClass
- SpeechRecognitionErrorEvent
- SpeechRecognitionEvent
- SpeechRecognitionResult
Ƭ SpeechEndCallback: () => void
▸ (): void
Callback that is invoked when transcription ends
void
Ƭ SpeechErrorCallback: (speechRecognitionErrorEvent: SpeechRecognitionErrorEvent) => void
▸ (speechRecognitionErrorEvent): void
Callback that is invoked when an error occurs
| Name | Type |
|---|---|
speechRecognitionErrorEvent |
SpeechRecognitionErrorEvent |
void
Ƭ SpeechRecognitionEventCallback: (speechRecognitionEvent: SpeechRecognitionEvent) => void
▸ (speechRecognitionEvent): void
Callback that is invoked whenever the transcript gets updated
| Name | Type | Description |
|---|---|---|
speechRecognitionEvent |
SpeechRecognitionEvent |
Event containing updates to the transcript |
void
• Const MicrophoneNotAllowedError: SpeechRecognitionErrorEvent
Error emitted when the user does not give permission to use the microphone
• Const SpeechRecognitionFailedError: SpeechRecognitionErrorEvent
Generic error when speech recognition fails due to an unknown cause
▸ createSpeechlySpeechRecognition(appId): SpeechRecognitionClass
Returns a SpeechRecognition implementation that uses a given Speechly app ID to generate transcriptions using the Speechly API
| Name | Type | Description |
|---|---|---|
appId |
string |
Speechly app ID |
Class that implements the SpeechRecognition interface