Skip to content

Latest commit

 

History

History
141 lines (81 loc) · 3.9 KB

README.md

File metadata and controls

141 lines (81 loc) · 3.9 KB

native-speech-recognition

Improve/add missing features of the capacitor community Native speech recognition plugin

Install

npm install native-speech-recognition
npx cap sync

API

hasAudioPermission()

hasAudioPermission() => Promise<PermissionBool>

Check if the user has granted the record_audio permission.

Returns: Promise<PermissionBool>


checkAudioPermission()

checkAudioPermission() => Promise<AudioPermissionStatus>

Check record_audio permission.

Returns: Promise<AudioPermissionStatus>


requestAudioPermission()

requestAudioPermission() => Promise<AudioPermissionStatus>

Request record_audio permission. Resolves with the new permission status after the user has denied/granted the request.

Returns: Promise<AudioPermissionStatus>


hasSpeechRecognitionPermission()

hasSpeechRecognitionPermission() => Promise<PermissionBool>

Check if the user has granted the speech recognition permission.

Returns: Promise<PermissionBool>


checkSpeechRecognitionPermission()

checkSpeechRecognitionPermission() => Promise<SpeechRecognitionPermissionStatus>

Check speech recognition permission.

Returns: Promise<SpeechRecognitionPermissionStatus>


requestSpeechRecognitionPermission()

requestSpeechRecognitionPermission() => Promise<SpeechRecognitionPermissionStatus>

Request speech recognition permission. Resolves with the new permission status after the user has denied/granted the request.

Returns: Promise<SpeechRecognitionPermissionStatus>


Interfaces

PermissionBool

Prop Type Description
hasPermission boolean Permission state for record_audio alias.

AudioPermissionStatus

Prop Type Description
record_audio PermissionState Permission state for record_audio alias.

SpeechRecognitionPermissionStatus

Prop Type Description
speech_recognition PermissionState Permission state for Speech recognition.

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'