Skip to content

front-end-org/hci-asr

Repository files navigation

hci-asr

capacitor plugin for hci-asr

Install

npm install hci-asr
npx cap sync

API

checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


sdkInit(...)

sdkInit(options: InitOptions) => Promise<PromiseResult>
Param Type
options InitOptions

Returns: Promise<PromiseResult>

Since: 0.0.1


createRecorder(...)

createRecorder(second: number) => Promise<PromiseResult>
Param Type
second number

Returns: Promise<PromiseResult>


startRecord()

startRecord() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


stopRecord(...)

stopRecord(cancel: boolean) => Promise<PromiseResult>
Param Type
cancel boolean

Returns: Promise<PromiseResult>


startRecognize(...)

startRecognize(language: RecognizeLanguage) => Promise<PromiseResult>
Param Type
language RecognizeLanguage

Returns: Promise<PromiseResult>


cancelRecognize()

cancelRecognize() => Promise<PromiseResult>

Returns: Promise<PromiseResult>


Interfaces

PermissionStatus

Prop Type
access_network_state PermissionState
internet PermissionState
microphone PermissionState
storage PermissionState

PromiseResult

Prop Type
success boolean
message string
result any

InitOptions

Prop Type
appKey string
secret string
sysUrl string
capUrl string

Type Aliases

PermissionState

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

Enums

RecognizeLanguage

Members Value
chinese 'cn_16k_common'
shanghai 'x-shanghai_16k_common'