plugin to use the microphone
npm install capacitor-microphoneplugin to use the microphone
``bash`
npm install capacitor-microphone
npx cap sync
* checkPermission()
* requestPermission()
* checkRequestPermission()
* startListening(...)
* stopListening()
* addListener('partialResult', ...)
* removeAllListeners()
* restartListening(...)
* Interfaces
`typescript`
checkPermission() => Promise
Returns: Promise<MicrophonePermissions>
--------------------
`typescript`
requestPermission() => Promise
Returns: Promise<MicrophonePermissions>
--------------------
`typescript`
checkRequestPermission() => Promise
Returns: Promise<MicrophonePermissions>
--------------------
`typescript`
startListening(options?: StartListeningOptions | undefined) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------------------- |
| options | StartListeningOptions |
--------------------
`typescript`
stopListening() => Promise
--------------------
`typescript`
addListener(eventName: 'partialResult', listenerFunc: (data: SpeechResult) => void) => Promise
| Param | Type |
| ------------------ | ------------------------------------------------------------------------ |
| eventName | 'partialResult' |
| listenerFunc | (data: SpeechResult) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
removeAllListeners() => Promise
--------------------
`typescript`
restartListening(options?: StartListeningOptions | undefined) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------------------- |
| options | StartListeningOptions |
--------------------
#### MicrophonePermissions
| Prop | Type |
| ------------------ | -------------------- |
| details | string |
| granted | boolean |
| status | string |
| errorMessage | string |
#### StartListeningOptions
| Prop | Type |
| ---------- | ------------------- |
| lang | string |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
#### SpeechResult
| Prop | Type |
| ------------- | -------------------- |
| text | string |
| isFinal` | boolean |