Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Latest commit

 

History

History
159 lines (89 loc) · 4.34 KB

File metadata and controls

159 lines (89 loc) · 4.34 KB

@speechly/speech-recognition-polyfill

@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

Table of contents

Interfaces

Type Aliases

Variables

Functions

Type Aliases

SpeechEndCallback

Ƭ SpeechEndCallback: () => void

Type declaration

▸ (): void

Callback that is invoked when transcription ends

Returns

void

Defined in

types.ts:97


SpeechErrorCallback

Ƭ SpeechErrorCallback: (speechRecognitionErrorEvent: SpeechRecognitionErrorEvent) => void

Type declaration

▸ (speechRecognitionErrorEvent): void

Callback that is invoked when an error occurs

Parameters
Name Type
speechRecognitionErrorEvent SpeechRecognitionErrorEvent
Returns

void

Defined in

types.ts:103


SpeechRecognitionEventCallback

Ƭ SpeechRecognitionEventCallback: (speechRecognitionEvent: SpeechRecognitionEvent) => void

Type declaration

▸ (speechRecognitionEvent): void

Callback that is invoked whenever the transcript gets updated

Parameters
Name Type Description
speechRecognitionEvent SpeechRecognitionEvent Event containing updates to the transcript
Returns

void

Defined in

types.ts:91

Variables

MicrophoneNotAllowedError

Const MicrophoneNotAllowedError: SpeechRecognitionErrorEvent

Error emitted when the user does not give permission to use the microphone

Defined in

types.ts:72


SpeechRecognitionFailedError

Const SpeechRecognitionFailedError: SpeechRecognitionErrorEvent

Generic error when speech recognition fails due to an unknown cause

Defined in

types.ts:81

Functions

createSpeechlySpeechRecognition

createSpeechlySpeechRecognition(appId): SpeechRecognitionClass

Returns a SpeechRecognition implementation that uses a given Speechly app ID to generate transcriptions using the Speechly API

Parameters

Name Type Description
appId string Speechly app ID

Returns

SpeechRecognitionClass

Class that implements the SpeechRecognition interface

Defined in

createSpeechRecognition.ts:27