You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Events are largely based on the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition). The following events are supported:
|`audiostart`| Audio capturing has started | Includes the `uri` if `recordingOptions.persist` is enabled. |
318
-
|`audioend`| Audio capturing has ended | Includes the `uri` if `recordingOptions.persist` is enabled. |
319
-
|`end`| Speech recognition service has disconnected. | This should always be the last event dispatched, including after errors. |
320
-
|`error`| Fired when a speech recognition error occurs. | You'll also receive an `error` event (with code "aborted") when calling `.abort()`|
321
-
|`nomatch`| Speech recognition service returns a final result with no significant recognition. | You may have non-final results recognized. This may get emitted after cancellation. |
322
-
|`result`| Speech recognition service returns a word or phrase has been positively recognized. | On Android, continous mode runs as a segmented session, meaning when a final result is reached, additional partial and final results will cover a new segment separate from the previous final result. On iOS, you should expect one final result before speech recognition has stopped. |
323
-
|`speechstart`| Fired when any sound — recognizable speech or not — has been detected | On iOS, this will fire once in the session after a result has occurred |
324
-
|`speechend`| Fired when speech recognized by the speech recognition service has stopped being detected. | Not supported yet on iOS |
325
-
|`start`| Speech recognition has started | Use this event to indicate to the user when to speak. |
|`audiostart`| Audio capturing has started | Includes the `uri` if `recordingOptions.persist` is enabled. |
327
+
|`audioend`| Audio capturing has ended | Includes the `uri` if `recordingOptions.persist` is enabled. |
328
+
|`end`| Speech recognition service has disconnected. | This should always be the last event dispatched, including after errors. |
329
+
|`error`| Fired when a speech recognition error occurs. | You'll also receive an `error` event (with code "aborted") when calling `.abort()`|
330
+
|`nomatch`| Speech recognition service returns a final result with no significant recognition. | You may have non-final results recognized. This may get emitted after cancellation. |
331
+
|`result`| Speech recognition service returns a word or phrase has been positively recognized. | On Android, continous mode runs as a segmented session, meaning when a final result is reached, additional partial and final results will cover a new segment separate from the previous final result. On iOS, you should expect one final result before speech recognition has stopped. |
332
+
|`speechstart`| Fired when any sound — recognizable speech or not — has been detected | On iOS, this will fire once in the session after a result has occurred |
333
+
|`speechend`| Fired when speech recognized by the speech recognition service has stopped being detected. | Not supported yet on iOS |
334
+
|`start`| Speech recognition has started | Use this event to indicate to the user when to speak. |
335
+
|`volumechange`| Fired when the input volume changes. | Returns a value between -2 and 10 indicating the volume of the input audio. Consider anything below 0 to be inaudible. |
326
336
327
337
## Handling Errors
328
338
@@ -530,6 +540,43 @@ function TranscribeAudioFile() {
530
540
}
531
541
```
532
542
543
+
## Volume metering
544
+
545
+
You can use the `volumeChangeEventOptions.enabled` option to enable volume metering. This will emit a `volumechange` event with the current volume level (between -2 and 10) as a value. You can use this value to animate the volume metering of a user's voice, or to provide feedback to the user about the volume level.
See: [VolumeMeteringAvatar.tsx](https://github.com/jamsch/expo-speech-recognition/tree/main/example/components/VolumeMeteringAvatar.tsx) for a complete example that involves using `react-native-reanimated` to animate the volume metering.
0 commit comments