expo-speech-recognition 0.2.22 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +112 -24
- package/android/src/main/java/expo/modules/speechrecognition/ExpoSpeechRecognitionModule.kt +22 -12
- package/android/src/main/java/expo/modules/speechrecognition/ExpoSpeechRecognitionOptions.kt +11 -0
- package/android/src/main/java/expo/modules/speechrecognition/ExpoSpeechService.kt +57 -3
- package/build/ExpoSpeechRecognitionModule.types.d.ts +60 -2
- package/build/ExpoSpeechRecognitionModule.types.d.ts.map +1 -1
- package/build/ExpoSpeechRecognitionModule.types.js.map +1 -1
- package/ios/ExpoSpeechRecognitionException.swift +6 -6
- package/ios/ExpoSpeechRecognitionModule.swift +38 -6
- package/ios/ExpoSpeechRecognizer.swift +115 -14
- package/ios/SpeechRecognitionOptions.swift +11 -0
- package/package.json +6 -1
- package/src/ExpoSpeechRecognitionModule.types.ts +62 -2
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -19,9 +19,12 @@ expo-speech-recognition implements the iOS [`SFSpeechRecognizer`](https://develo
|
|
|
19
19
|
- [Transcribing audio files](#transcribing-audio-files)
|
|
20
20
|
- [Supported input audio formats](#supported-input-audio-formats)
|
|
21
21
|
- [File transcription example](#file-transcription-example)
|
|
22
|
+
- [Volume metering](#volume-metering)
|
|
23
|
+
- [Volume metering example](#volume-metering-example)
|
|
22
24
|
- [Polyfilling the Web SpeechRecognition API](#polyfilling-the-web-speechrecognition-api)
|
|
23
25
|
- [Muting the beep sound on Android](#muting-the-beep-sound-on-android)
|
|
24
26
|
- [Improving accuracy of single-word prompts](#improving-accuracy-of-single-word-prompts)
|
|
27
|
+
- [Language Detection](#language-detection)
|
|
25
28
|
- [Platform Compatibility Table](#platform-compatibility-table)
|
|
26
29
|
- [Common Troubleshooting issues](#common-troubleshooting-issues)
|
|
27
30
|
- [Android issues](#android-issues)
|
|
@@ -34,14 +37,14 @@ expo-speech-recognition implements the iOS [`SFSpeechRecognizer`](https://develo
|
|
|
34
37
|
- [getPermissionsAsync()](#getpermissionsasync-promisepermissionresponse)
|
|
35
38
|
- [getStateAsync()](#getstateasync-promisespeechrecognitionstate)
|
|
36
39
|
- [addSpeechRecognitionListener()](#addspeechrecognitionlistener)
|
|
37
|
-
- [getSupportedLocales()](#getsupportedlocales
|
|
40
|
+
- [getSupportedLocales()](#getsupportedlocales)
|
|
38
41
|
- [getSpeechRecognitionServices()](#getspeechrecognitionservices-string-android-only)
|
|
39
42
|
- [getDefaultRecognitionService()](#getdefaultrecognitionservice--packagename-string--android-only)
|
|
40
43
|
- [getAssistantService()](#getassistantservice--packagename-string--android-only)
|
|
41
44
|
- [isRecognitionAvailable()](#isrecognitionavailable-boolean)
|
|
42
45
|
- [supportsOnDeviceRecognition()](#supportsondevicerecognition-boolean)
|
|
43
46
|
- [supportsRecording()](#supportsrecording-boolean)
|
|
44
|
-
- [androidTriggerOfflineModelDownload()](#androidtriggerofflinemodeldownload
|
|
47
|
+
- [androidTriggerOfflineModelDownload()](#androidtriggerofflinemodeldownload)
|
|
45
48
|
- [setCategoryIOS()](#setcategoryios-void-ios-only)
|
|
46
49
|
- [getAudioSessionCategoryAndOptionsIOS()](#getaudiosessioncategoryandoptionsios-ios-only)
|
|
47
50
|
- [setAudioSessionActiveIOS()](#setaudiosessionactiveiosvalue-boolean-options--notifyothersondeactivation-boolean--void)
|
|
@@ -96,10 +99,13 @@ If you've just created a new Expo project or have only been using the Expo SDK s
|
|
|
96
99
|
After completing **Step 2: Configure the config plugin**, follow these steps:
|
|
97
100
|
|
|
98
101
|
- To (re)-generate the native Android project, run:
|
|
102
|
+
|
|
99
103
|
```bash
|
|
100
104
|
npx expo run:android
|
|
101
105
|
```
|
|
106
|
+
|
|
102
107
|
- To (re)-generate the native iOS project, run:
|
|
108
|
+
|
|
103
109
|
```bash
|
|
104
110
|
npx expo run:ios
|
|
105
111
|
```
|
|
@@ -136,7 +142,7 @@ function App() {
|
|
|
136
142
|
setTranscript(event.results[0]?.transcript);
|
|
137
143
|
});
|
|
138
144
|
useSpeechRecognitionEvent("error", (event) => {
|
|
139
|
-
console.log("error code:", event.error, "error
|
|
145
|
+
console.log("error code:", event.error, "error message:", event.message);
|
|
140
146
|
});
|
|
141
147
|
|
|
142
148
|
const handleStart = async () => {
|
|
@@ -226,7 +232,7 @@ const resultListener = addSpeechRecognitionListener("result", (event) => {
|
|
|
226
232
|
});
|
|
227
233
|
|
|
228
234
|
const errorListener = addSpeechRecognitionListener("error", (event) => {
|
|
229
|
-
console.log("error code:", event.error, "error
|
|
235
|
+
console.log("error code:", event.error, "error message:", event.message);
|
|
230
236
|
});
|
|
231
237
|
|
|
232
238
|
// Start speech recognition
|
|
@@ -237,12 +243,15 @@ ExpoSpeechRecognitionModule.start({
|
|
|
237
243
|
// The maximum number of alternative transcriptions to return.
|
|
238
244
|
maxAlternatives: 1,
|
|
239
245
|
// [Default: false] Continuous recognition.
|
|
240
|
-
// If false
|
|
246
|
+
// If false:
|
|
247
|
+
// - on iOS 17-, recognition will run until no speech is detected for 3 seconds.
|
|
248
|
+
// - on iOS 18+ and Android, recognition will run until a final result is received.
|
|
241
249
|
// Not supported on Android 12 and below.
|
|
242
250
|
continuous: true,
|
|
243
251
|
// [Default: false] Prevent device from sending audio over the network. Only enabled if the device supports it.
|
|
244
252
|
requiresOnDeviceRecognition: false,
|
|
245
253
|
// [Default: false] Include punctuation in the recognition results. This applies to full stops and commas.
|
|
254
|
+
// Not supported on Android 12 and below. On Android 13+, only supported when on-device recognition is enabled.
|
|
246
255
|
addsPunctuation: false,
|
|
247
256
|
// [Default: undefined] Short custom phrases that are unique to your app.
|
|
248
257
|
contextualStrings: ["Carlsen", "Nepomniachtchi", "Praggnanandhaa"],
|
|
@@ -297,6 +306,13 @@ ExpoSpeechRecognitionModule.start({
|
|
|
297
306
|
// Default: 50ms for network-based recognition, 15ms for on-device recognition
|
|
298
307
|
chunkDelayMillis: undefined,
|
|
299
308
|
},
|
|
309
|
+
// Settings for volume change events.
|
|
310
|
+
volumeChangeEventOptions: {
|
|
311
|
+
// [Default: false] Whether to emit the `volumechange` events when the input volume changes.
|
|
312
|
+
enabled: false,
|
|
313
|
+
// [Default: 100ms on iOS] The interval (in milliseconds) to emit `volumechange` events.
|
|
314
|
+
intervalMillis: 300,
|
|
315
|
+
},
|
|
300
316
|
});
|
|
301
317
|
|
|
302
318
|
// Stop capturing audio (and emit a final result if there is one)
|
|
@@ -310,17 +326,19 @@ ExpoSpeechRecognitionModule.abort();
|
|
|
310
326
|
|
|
311
327
|
Events are largely based on the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition). The following events are supported:
|
|
312
328
|
|
|
313
|
-
| Event Name
|
|
314
|
-
|
|
|
315
|
-
| `audiostart`
|
|
316
|
-
| `audioend`
|
|
317
|
-
| `end`
|
|
318
|
-
| `error`
|
|
319
|
-
| `nomatch`
|
|
320
|
-
| `result`
|
|
321
|
-
| `speechstart`
|
|
322
|
-
| `speechend`
|
|
323
|
-
| `start`
|
|
329
|
+
| Event Name | Description | Notes |
|
|
330
|
+
| ------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
331
|
+
| `audiostart` | Audio capturing has started | Includes the `uri` if `recordingOptions.persist` is enabled. |
|
|
332
|
+
| `audioend` | Audio capturing has ended | Includes the `uri` if `recordingOptions.persist` is enabled. |
|
|
333
|
+
| `end` | Speech recognition service has disconnected. | This should always be the last event dispatched, including after errors. |
|
|
334
|
+
| `error` | Fired when a speech recognition error occurs. | You'll also receive an `error` event (with code "aborted") when calling `.abort()` |
|
|
335
|
+
| `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. |
|
|
336
|
+
| `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. |
|
|
337
|
+
| `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 |
|
|
338
|
+
| `speechend` | Fired when speech recognized by the speech recognition service has stopped being detected. | Not supported yet on iOS |
|
|
339
|
+
| `start` | Speech recognition has started | Use this event to indicate to the user when to speak. |
|
|
340
|
+
| `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. |
|
|
341
|
+
| `languagedetection` | Called when the language detection (and switching) results are available. | Android 14+ only with `com.google.android.as`. Enabled with `EXTRA_ENABLE_LANGUAGE_DETECTION` in the `androidIntent` option when starting. Also can be called multiple times by enabling `EXTRA_ENABLE_LANGUAGE_SWITCH`. |
|
|
324
342
|
|
|
325
343
|
## Handling Errors
|
|
326
344
|
|
|
@@ -334,12 +352,12 @@ import {
|
|
|
334
352
|
} from "expo-speech-recognition";
|
|
335
353
|
|
|
336
354
|
addSpeechRecognitionListener("error", (event) => {
|
|
337
|
-
console.log("error code:", event.error, "error
|
|
355
|
+
console.log("error code:", event.error, "error message:", event.message);
|
|
338
356
|
});
|
|
339
357
|
|
|
340
358
|
// or through the `useSpeechRecognitionEvent` hook
|
|
341
359
|
useSpeechRecognitionEvent("error", (event) => {
|
|
342
|
-
console.log("error code:", event.error, "error
|
|
360
|
+
console.log("error code:", event.error, "error message:", event.message);
|
|
343
361
|
});
|
|
344
362
|
|
|
345
363
|
// or through the `ExpoSpeechRecognitionErrorCode` type
|
|
@@ -528,6 +546,44 @@ function TranscribeAudioFile() {
|
|
|
528
546
|
}
|
|
529
547
|
```
|
|
530
548
|
|
|
549
|
+
## Volume metering
|
|
550
|
+
|
|
551
|
+
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.
|
|
552
|
+
|
|
553
|
+
### Volume metering example
|
|
554
|
+
|
|
555
|
+

|
|
556
|
+
|
|
557
|
+
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.
|
|
558
|
+
|
|
559
|
+
```tsx
|
|
560
|
+
import { Button } from "react-native";
|
|
561
|
+
import {
|
|
562
|
+
ExpoSpeechRecognitionModule,
|
|
563
|
+
useSpeechRecognitionEvent,
|
|
564
|
+
} from "expo-speech-recognition";
|
|
565
|
+
|
|
566
|
+
function VolumeMeteringExample() {
|
|
567
|
+
useSpeechRecognitionEvent("volumechange", (event) => {
|
|
568
|
+
// a value between -2 and 10. <= 0 is inaudible
|
|
569
|
+
console.log("Volume changed to:", event.value);
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
const handleStart = () => {
|
|
573
|
+
ExpoSpeechRecognitionModule.start({
|
|
574
|
+
lang: "en-US",
|
|
575
|
+
volumeChangeEventOptions: {
|
|
576
|
+
enabled: true,
|
|
577
|
+
// how often you want to receive the volumechange event
|
|
578
|
+
intervalMillis: 300,
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
return <Button title="Start" onPress={handleStart} />;
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
531
587
|
## Polyfilling the Web SpeechRecognition API
|
|
532
588
|
|
|
533
589
|
> [!IMPORTANT]
|
|
@@ -593,7 +649,7 @@ const handleResult = (event: SpeechRecognitionEvent) => {
|
|
|
593
649
|
recognition.registerEventListener("result", handleResult);
|
|
594
650
|
|
|
595
651
|
recognition.registerEventListener("error", (event) => {
|
|
596
|
-
console.log("error code:", event.error, "error
|
|
652
|
+
console.log("error code:", event.error, "error message:", event.message);
|
|
597
653
|
});
|
|
598
654
|
|
|
599
655
|
recognition.registerEventListener("end", (event) => console.log("ended!"));
|
|
@@ -645,6 +701,39 @@ You may notice that after saying short syllables, words, letters, or numbers (e.
|
|
|
645
701
|
- For both platforms, you also may want to consider using on-device recognition. On Android this seems to work well for single-word prompts.
|
|
646
702
|
- Alternatively, you may want to consider recording the recognized audio and sending it to an external service for further processing. See [Persisting Audio Recordings](#persisting-audio-recordings) for more information. Note that some services (such as the Google Speech API) may require an audio file with a duration of at least 3 seconds.
|
|
647
703
|
|
|
704
|
+
## Language Detection
|
|
705
|
+
|
|
706
|
+
> [!NOTE]
|
|
707
|
+
> This feature is currently only available on Android 14+ using the `com.google.android.as` service package.
|
|
708
|
+
|
|
709
|
+
You can use the `languagedetection` event to get the detected language and confidence level. This feature has a few requirements:
|
|
710
|
+
|
|
711
|
+
- Android 14+ only.
|
|
712
|
+
- The `com.google.android.as` (on-device recognition) service package must be selected. This seems to be the only service that supports language detection as of writing this.
|
|
713
|
+
- You must enable `EXTRA_ENABLE_LANGUAGE_DETECTION` in the `androidIntentOptions` when starting the recognition.
|
|
714
|
+
- Optional: You can enable `EXTRA_ENABLE_LANGUAGE_SWITCH` to allow the user to switch languages, however **keep in mind that you need the language model to be downloaded for this to work**. Refer to [androidTriggerOfflineModelDownload()](#androidtriggerofflinemodeldownload) to download a model, and [getSupportedLocales()](#getsupportedlocales) to get the list of downloaded on-device locales.
|
|
715
|
+
|
|
716
|
+
Example:
|
|
717
|
+
|
|
718
|
+
```tsx
|
|
719
|
+
import { useSpeechRecognitionEvent } from "expo-speech-recognition";
|
|
720
|
+
|
|
721
|
+
useSpeechRecognitionEvent("languagedetection", (event) => {
|
|
722
|
+
console.log("Language detected:", event.detectedLanguage); // e.g. "en-us"
|
|
723
|
+
console.log("Confidence:", event.confidence); // A value between 0.0 and 1.0
|
|
724
|
+
console.log("Top locale alternatives:", event.topLocaleAlternatives); // e.g. ["en-au", "en-gb"]
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
// Start recognition
|
|
728
|
+
ExpoSpeechRecognitionModule.start({
|
|
729
|
+
androidIntentOptions: {
|
|
730
|
+
EXTRA_ENABLE_LANGUAGE_DETECTION: true,
|
|
731
|
+
EXTRA_ENABLE_LANGUAGE_SWITCH: true,
|
|
732
|
+
},
|
|
733
|
+
androidRecognitionServicePackage: "com.google.android.as", // or set "requiresOnDeviceRecognition" to true
|
|
734
|
+
});
|
|
735
|
+
```
|
|
736
|
+
|
|
648
737
|
## Platform Compatibility Table
|
|
649
738
|
|
|
650
739
|
As of 7 Aug 2024, the following platforms are supported:
|
|
@@ -740,10 +829,9 @@ ExpoSpeechRecognitionModule.abort();
|
|
|
740
829
|
|
|
741
830
|
### `requestPermissionsAsync(): Promise<PermissionResponse>`
|
|
742
831
|
|
|
743
|
-
Presents a dialog to the user to request
|
|
832
|
+
Presents a dialog to the user to request the necessary permissions.
|
|
744
833
|
|
|
745
|
-
For iOS,
|
|
746
|
-
the only way that the permissions can be changed is by the user themselves using the device settings app.
|
|
834
|
+
For iOS, this requests two permissions: record permissions (to access the microphone), and speech recognition permissions. Once a user has granted (or denied) permissions by responding to the original permission request dialog, the only way that the permissions can be changed is by the user themselves using the device settings app.
|
|
747
835
|
|
|
748
836
|
```ts
|
|
749
837
|
import { ExpoSpeechRecognitionModule } from "expo-speech-recognition";
|
|
@@ -801,7 +889,7 @@ const listener = addSpeechRecognitionListener("result", (event) => {
|
|
|
801
889
|
listener.remove();
|
|
802
890
|
```
|
|
803
891
|
|
|
804
|
-
### `getSupportedLocales()
|
|
892
|
+
### `getSupportedLocales()`
|
|
805
893
|
|
|
806
894
|
> [!NOTE]
|
|
807
895
|
> Not supported on Android 12 and below
|
|
@@ -915,7 +1003,7 @@ const available = supportsRecording();
|
|
|
915
1003
|
console.log("Recording available:", available);
|
|
916
1004
|
```
|
|
917
1005
|
|
|
918
|
-
### `androidTriggerOfflineModelDownload(
|
|
1006
|
+
### `androidTriggerOfflineModelDownload()`
|
|
919
1007
|
|
|
920
1008
|
Users on Android devices will first need to download the offline model for the locale they want to use in order to use on-device speech recognition (i.e. the `requiresOnDeviceRecognition` setting in the `start` options).
|
|
921
1009
|
|
|
@@ -86,6 +86,10 @@ class ExpoSpeechRecognitionModule : Module() {
|
|
|
86
86
|
"start",
|
|
87
87
|
// Called when there's results (as a string array, not API compliant)
|
|
88
88
|
"results",
|
|
89
|
+
// Called when the language detection (and switching) results are available.
|
|
90
|
+
"languagedetection",
|
|
91
|
+
// Fired when the input volume changes
|
|
92
|
+
"volumechange",
|
|
89
93
|
)
|
|
90
94
|
|
|
91
95
|
Function("getDefaultRecognitionService") {
|
|
@@ -325,26 +329,32 @@ class ExpoSpeechRecognitionModule : Module() {
|
|
|
325
329
|
promise: Promise,
|
|
326
330
|
) {
|
|
327
331
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
|
328
|
-
promise.resolve(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
+
promise.resolve(
|
|
333
|
+
mapOf(
|
|
334
|
+
"locales" to mutableListOf<String>(),
|
|
335
|
+
"installedLocales" to mutableListOf<String>(),
|
|
336
|
+
),
|
|
337
|
+
)
|
|
332
338
|
return
|
|
333
339
|
}
|
|
334
340
|
|
|
335
341
|
if (options.androidRecognitionServicePackage == null && !SpeechRecognizer.isOnDeviceRecognitionAvailable(appContext)) {
|
|
336
|
-
promise.resolve(
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
342
|
+
promise.resolve(
|
|
343
|
+
mapOf(
|
|
344
|
+
"locales" to mutableListOf<String>(),
|
|
345
|
+
"installedLocales" to mutableListOf<String>(),
|
|
346
|
+
),
|
|
347
|
+
)
|
|
340
348
|
return
|
|
341
349
|
}
|
|
342
350
|
|
|
343
351
|
if (options.androidRecognitionServicePackage != null && !SpeechRecognizer.isRecognitionAvailable(appContext)) {
|
|
344
|
-
promise.resolve(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
352
|
+
promise.resolve(
|
|
353
|
+
mapOf(
|
|
354
|
+
"locales" to mutableListOf<String>(),
|
|
355
|
+
"installedLocales" to mutableListOf<String>(),
|
|
356
|
+
),
|
|
357
|
+
)
|
|
348
358
|
return
|
|
349
359
|
}
|
|
350
360
|
|
package/android/src/main/java/expo/modules/speechrecognition/ExpoSpeechRecognitionOptions.kt
CHANGED
|
@@ -50,6 +50,17 @@ class SpeechRecognitionOptions : Record {
|
|
|
50
50
|
|
|
51
51
|
@Field
|
|
52
52
|
val iosCategory: Map<String, Any>? = null
|
|
53
|
+
|
|
54
|
+
@Field
|
|
55
|
+
val volumeChangeEventOptions: VolumeChangeEventOptions? = null
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class VolumeChangeEventOptions : Record {
|
|
59
|
+
@Field
|
|
60
|
+
val enabled: Boolean? = false
|
|
61
|
+
|
|
62
|
+
@Field
|
|
63
|
+
val intervalMillis: Int? = null
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
class RecordingOptions : Record {
|
|
@@ -50,6 +50,9 @@ class ExpoSpeechService(
|
|
|
50
50
|
private var speech: SpeechRecognizer? = null
|
|
51
51
|
private val mainHandler = Handler(Looper.getMainLooper())
|
|
52
52
|
|
|
53
|
+
private lateinit var options: SpeechRecognitionOptions
|
|
54
|
+
private var lastVolumeChangeEventTime: Long = 0L
|
|
55
|
+
|
|
53
56
|
/** Audio recorder for persisting audio */
|
|
54
57
|
private var audioRecorder: ExpoAudioRecorder? = null
|
|
55
58
|
|
|
@@ -57,6 +60,9 @@ class ExpoSpeechService(
|
|
|
57
60
|
private var delayedFileStreamer: DelayedFileStreamer? = null
|
|
58
61
|
private var soundState = SoundState.INACTIVE
|
|
59
62
|
|
|
63
|
+
private var lastDetectedLanguage: String? = null
|
|
64
|
+
private var lastLanguageConfidence: Float? = null
|
|
65
|
+
|
|
60
66
|
var recognitionState = RecognitionState.INACTIVE
|
|
61
67
|
|
|
62
68
|
companion object {
|
|
@@ -108,6 +114,7 @@ class ExpoSpeechService(
|
|
|
108
114
|
|
|
109
115
|
/** Starts speech recognition */
|
|
110
116
|
fun start(options: SpeechRecognitionOptions) {
|
|
117
|
+
this.options = options
|
|
111
118
|
mainHandler.post {
|
|
112
119
|
log("Start recognition.")
|
|
113
120
|
|
|
@@ -117,8 +124,11 @@ class ExpoSpeechService(
|
|
|
117
124
|
audioRecorder = null
|
|
118
125
|
delayedFileStreamer?.close()
|
|
119
126
|
delayedFileStreamer = null
|
|
127
|
+
lastDetectedLanguage = null
|
|
128
|
+
lastLanguageConfidence = null
|
|
120
129
|
recognitionState = RecognitionState.STARTING
|
|
121
130
|
soundState = SoundState.INACTIVE
|
|
131
|
+
lastVolumeChangeEventTime = 0L
|
|
122
132
|
try {
|
|
123
133
|
val intent = createSpeechIntent(options)
|
|
124
134
|
speech = createSpeechRecognizer(options)
|
|
@@ -428,12 +438,12 @@ class ExpoSpeechService(
|
|
|
428
438
|
*/
|
|
429
439
|
private fun resolveSourceUri(sourceUri: String): File =
|
|
430
440
|
when {
|
|
431
|
-
// Local file path without URI scheme
|
|
432
|
-
!sourceUri.startsWith("https://") && !sourceUri.startsWith("file://") -> File(sourceUri)
|
|
433
|
-
|
|
434
441
|
// File URI
|
|
435
442
|
sourceUri.startsWith("file://") -> File(URI(sourceUri))
|
|
436
443
|
|
|
444
|
+
// Local file path without URI scheme
|
|
445
|
+
!sourceUri.startsWith("https://") -> File(sourceUri)
|
|
446
|
+
|
|
437
447
|
// HTTP URI - throw an error
|
|
438
448
|
else -> {
|
|
439
449
|
throw Exception("HTTP URI is not supported. Use expo-file-system to download the file.")
|
|
@@ -454,6 +464,21 @@ class ExpoSpeechService(
|
|
|
454
464
|
}
|
|
455
465
|
|
|
456
466
|
override fun onRmsChanged(rmsdB: Float) {
|
|
467
|
+
if (options.volumeChangeEventOptions?.enabled != true) {
|
|
468
|
+
return
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
val intervalMs = options.volumeChangeEventOptions?.intervalMillis
|
|
472
|
+
|
|
473
|
+
if (intervalMs == null) {
|
|
474
|
+
sendEvent("volumechange", mapOf("value" to rmsdB))
|
|
475
|
+
} else {
|
|
476
|
+
val currentTime = System.currentTimeMillis()
|
|
477
|
+
if (currentTime - lastVolumeChangeEventTime >= intervalMs) {
|
|
478
|
+
sendEvent("volumechange", mapOf("value" to rmsdB))
|
|
479
|
+
lastVolumeChangeEventTime = currentTime
|
|
480
|
+
}
|
|
481
|
+
}
|
|
457
482
|
/*
|
|
458
483
|
val isSilent = rmsdB <= 0
|
|
459
484
|
|
|
@@ -561,6 +586,15 @@ class ExpoSpeechService(
|
|
|
561
586
|
else -> 0.0f
|
|
562
587
|
}
|
|
563
588
|
|
|
589
|
+
private fun languageDetectionConfidenceLevelToFloat(confidenceLevel: Int): Float =
|
|
590
|
+
when (confidenceLevel) {
|
|
591
|
+
SpeechRecognizer.LANGUAGE_DETECTION_CONFIDENCE_LEVEL_HIGHLY_CONFIDENT -> 1.0f
|
|
592
|
+
SpeechRecognizer.LANGUAGE_DETECTION_CONFIDENCE_LEVEL_CONFIDENT -> 0.8f
|
|
593
|
+
SpeechRecognizer.LANGUAGE_DETECTION_CONFIDENCE_LEVEL_NOT_CONFIDENT -> 0.5f
|
|
594
|
+
SpeechRecognizer.LANGUAGE_DETECTION_CONFIDENCE_LEVEL_UNKNOWN -> 0f
|
|
595
|
+
else -> 0.0f
|
|
596
|
+
}
|
|
597
|
+
|
|
564
598
|
override fun onResults(results: Bundle?) {
|
|
565
599
|
val resultsList = getResults(results)
|
|
566
600
|
|
|
@@ -594,6 +628,26 @@ class ExpoSpeechService(
|
|
|
594
628
|
}
|
|
595
629
|
}
|
|
596
630
|
|
|
631
|
+
override fun onLanguageDetection(results: Bundle) {
|
|
632
|
+
val detectedLanguage = results.getString(SpeechRecognizer.DETECTED_LANGUAGE)
|
|
633
|
+
val confidence = languageDetectionConfidenceLevelToFloat(results.getInt(SpeechRecognizer.LANGUAGE_DETECTION_CONFIDENCE_LEVEL))
|
|
634
|
+
|
|
635
|
+
// Only send event if language or confidence has changed
|
|
636
|
+
if (detectedLanguage != lastDetectedLanguage || confidence != lastLanguageConfidence) {
|
|
637
|
+
lastDetectedLanguage = detectedLanguage
|
|
638
|
+
lastLanguageConfidence = confidence
|
|
639
|
+
|
|
640
|
+
sendEvent(
|
|
641
|
+
"languagedetection",
|
|
642
|
+
mapOf(
|
|
643
|
+
"detectedLanguage" to detectedLanguage,
|
|
644
|
+
"confidence" to confidence,
|
|
645
|
+
"topLocaleAlternatives" to results.getStringArrayList(SpeechRecognizer.TOP_LOCALE_ALTERNATIVES),
|
|
646
|
+
),
|
|
647
|
+
)
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
597
651
|
/**
|
|
598
652
|
* For API 33: Basically same as onResults but doesn't stop
|
|
599
653
|
*/
|
|
@@ -70,6 +70,22 @@ export type ExpoSpeechRecognitionErrorEvent = {
|
|
|
70
70
|
error: ExpoSpeechRecognitionErrorCode;
|
|
71
71
|
message: string;
|
|
72
72
|
};
|
|
73
|
+
export type LanguageDetectionEvent = {
|
|
74
|
+
/** The language that was detected, in BCP-47 format. e.g. "en-US", "de-DE" */
|
|
75
|
+
detectedLanguage: string;
|
|
76
|
+
/** The confidence of the detected language. A value ranging between 0.0 and 1.0.
|
|
77
|
+
*
|
|
78
|
+
* Values range from:
|
|
79
|
+
*
|
|
80
|
+
* - 1.0 (highly confident)
|
|
81
|
+
* - 0.8 (confident)
|
|
82
|
+
* - 0.5 (not confident)
|
|
83
|
+
* - 0.0 (unknown)
|
|
84
|
+
*/
|
|
85
|
+
confidence: number;
|
|
86
|
+
/** The alternative locales for the same language, in BCP-47 format. e.g. ["en-US", "en-GB"] */
|
|
87
|
+
topLocaleAlternatives: string[];
|
|
88
|
+
};
|
|
73
89
|
/**
|
|
74
90
|
* Events that are dispatched from the native side
|
|
75
91
|
*/
|
|
@@ -109,6 +125,15 @@ export type ExpoSpeechRecognitionNativeEventMap = {
|
|
|
109
125
|
end: null;
|
|
110
126
|
soundstart: null;
|
|
111
127
|
soundend: null;
|
|
128
|
+
languagedetection: LanguageDetectionEvent;
|
|
129
|
+
volumechange: {
|
|
130
|
+
/**
|
|
131
|
+
* A float value between -2 and 10 indicating the volume of the input audio
|
|
132
|
+
*
|
|
133
|
+
* Consider anything below 0 to be inaudible
|
|
134
|
+
*/
|
|
135
|
+
value: number;
|
|
136
|
+
};
|
|
112
137
|
};
|
|
113
138
|
export type ExpoSpeechRecognitionOptions = {
|
|
114
139
|
/** [Default: "en-US"] The language of the speech recognition */
|
|
@@ -130,7 +155,10 @@ export type ExpoSpeechRecognitionOptions = {
|
|
|
130
155
|
*
|
|
131
156
|
* Not supported on Android 12 and below.
|
|
132
157
|
*
|
|
133
|
-
* If false
|
|
158
|
+
* If false, the behaviors are the following:
|
|
159
|
+
*
|
|
160
|
+
* - on iOS 17-, recognition will run until no speech is detected for 3 seconds.
|
|
161
|
+
* - on iOS 18+ and Android, recognition will run until a result with `isFinal: true` is received.
|
|
134
162
|
*/
|
|
135
163
|
continuous?: boolean;
|
|
136
164
|
/** [Default: false] Prevent device from sending audio over the network. Only enabled if the device supports it.
|
|
@@ -141,7 +169,9 @@ export type ExpoSpeechRecognitionOptions = {
|
|
|
141
169
|
/**
|
|
142
170
|
* [Default: false] Include punctuation in the recognition results. This applies to full stops and commas.
|
|
143
171
|
*
|
|
144
|
-
* On Android, this configures [`EXTRA_ENABLE_FORMATTING`](https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_ENABLE_FORMATTING) in the recognizer intent (API level 33+).
|
|
172
|
+
* On Android, this configures [`EXTRA_ENABLE_FORMATTING`](https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_ENABLE_FORMATTING) in the recognizer intent (Android 13+, API level 33+).
|
|
173
|
+
*
|
|
174
|
+
* Note for Android: This feature is only verified to work on Android 13+ with on-device speech recognition enabled (i.e. enabling `requiresOnDeviceRecognition` or using the `com.google.android.as` service package)
|
|
145
175
|
*
|
|
146
176
|
* On iOS, this configures [`SFSpeechRecognitionRequest.addsPunctuation`](https://developer.apple.com/documentation/speech/sfspeechrecognitionrequest/3930023-addspunctuation).
|
|
147
177
|
*/
|
|
@@ -207,6 +237,25 @@ export type ExpoSpeechRecognitionOptions = {
|
|
|
207
237
|
* Docs: https://developer.apple.com/documentation/avfaudio/avaudiosession/category
|
|
208
238
|
*/
|
|
209
239
|
iosCategory?: SetCategoryOptions;
|
|
240
|
+
/**
|
|
241
|
+
* Settings for volume change events.
|
|
242
|
+
*/
|
|
243
|
+
volumeChangeEventOptions?: {
|
|
244
|
+
/**
|
|
245
|
+
* Whether to emit volume change events.
|
|
246
|
+
*
|
|
247
|
+
* Default: false
|
|
248
|
+
*/
|
|
249
|
+
enabled?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Specifies the interval (in milliseconds) to emit `volumechange` events.
|
|
252
|
+
*
|
|
253
|
+
* Default: 100ms on iOS
|
|
254
|
+
*
|
|
255
|
+
* Increasing this value will improve performance
|
|
256
|
+
*/
|
|
257
|
+
intervalMillis?: number;
|
|
258
|
+
};
|
|
210
259
|
};
|
|
211
260
|
export type IOSTaskHintValue = (typeof TaskHintIOS)[keyof typeof TaskHintIOS];
|
|
212
261
|
export type RecordingOptions = {
|
|
@@ -307,6 +356,15 @@ export type AndroidIntentOptions = {
|
|
|
307
356
|
* Depending on the recognizer implementation, this value may have no effect.
|
|
308
357
|
*/
|
|
309
358
|
EXTRA_ENABLE_LANGUAGE_SWITCH: (typeof RecognizerIntentEnableLanguageSwitch)[keyof typeof RecognizerIntentEnableLanguageSwitch];
|
|
359
|
+
/**
|
|
360
|
+
* https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_ENABLE_FORMATTING
|
|
361
|
+
*
|
|
362
|
+
* NOTE: This is also configurable through `addsPunctuation` (which sets `EXTRA_ENABLE_FORMATTING` to "quality")
|
|
363
|
+
*
|
|
364
|
+
* [API level 33] Optional string to enable text formatting (e.g. unspoken punctuation (examples: question mark, comma, period, etc.), capitalization, etc.) and specify the optimization strategy. If set, the partial and final result texts will be formatted. Each result list will contain two hypotheses in the order of 1) formatted text 2) raw text.
|
|
365
|
+
*
|
|
366
|
+
*/
|
|
367
|
+
EXTRA_ENABLE_FORMATTING: "latency" | "quality";
|
|
310
368
|
/**
|
|
311
369
|
* https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_HIDE_PARTIAL_TRAILING_PUNCTUATION
|
|
312
370
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSpeechRecognitionModule.types.d.ts","sourceRoot":"","sources":["../src/ExpoSpeechRecognitionModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,WAAW,EACZ,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAEvE,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,EAAE,kCAAkC,EAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,sDAAsD;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,qHAAqH;IACrH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,gCAAgC,GAAG;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,2BAA2B,EAAE,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,8BAA8B;AACxC,6DAA6D;AAC3D,SAAS;AACX,6BAA6B;GAC3B,eAAe;AACjB,kJAAkJ;GAChJ,aAAa;AACf,wDAAwD;GACtD,wBAAwB;AAC1B,4EAA4E;GAC1E,SAAS;AACX,oCAAoC;GAClC,WAAW;AACb,0EAA0E;GACxE,aAAa;AACf,iCAAiC;GAC/B,qBAAqB;AAEvB,6EAA6E;GAC3E,MAAM;AACR,4DAA4D;GAC1D,QAAQ;AACV,iCAAiC;GAC/B,gBAAgB;AAClB,8BAA8B;GAC5B,SAAS,CAAC;AAEd,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,EAAE,8BAA8B,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,MAAM,EAAE,gCAAgC,CAAC;IACzC,KAAK,EAAE,+BAA+B,CAAC;IACvC,KAAK,EAAE,IAAI,CAAC;IACZ,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,iEAAiE;IACjE,OAAO,EAAE,IAAI,CAAC;IACd,kCAAkC;IAClC,UAAU,EAAE;QACV;;;;;;;;WAQG;QACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,CAAC;IACF,gCAAgC;IAChC,QAAQ,EAAE;QACR;;;;;;;WAOG;QACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,CAAC;IACF,GAAG,EAAE,IAAI,CAAC;IACV,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoSpeechRecognitionModule.types.d.ts","sourceRoot":"","sources":["../src/ExpoSpeechRecognitionModule.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KA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