expo-speech-recognition 0.2.15 → 0.2.16
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/README.md +1 -1
- package/ios/ExpoSpeechRecognizer.swift +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🎙️ expo-speech-recognition
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
expo-speech-recognition implements the iOS [`SFSpeechRecognizer`](https://developer.apple.com/documentation/speech/sfspeechrecognizer), Android [`SpeechRecognizer`](https://developer.android.com/reference/android/speech/SpeechRecognizer) and Web [`SpeechRecognition`](https://wicg.github.io/speech-api/) for React Native projects with the goal of code reuse across web and mobile.
|
|
6
6
|
|
|
@@ -632,7 +632,10 @@ actor ExpoSpeechRecognizer: ObservableObject {
|
|
|
632
632
|
if let error: Error {
|
|
633
633
|
// TODO: don't emit no-speech if there were already interim results
|
|
634
634
|
Task { @MainActor in
|
|
635
|
-
|
|
635
|
+
if await task != nil {
|
|
636
|
+
// Don't emit any errors after the task has finished
|
|
637
|
+
errorHandler(error)
|
|
638
|
+
}
|
|
636
639
|
}
|
|
637
640
|
}
|
|
638
641
|
|
|
@@ -676,7 +679,6 @@ actor ExpoSpeechRecognizer: ObservableObject {
|
|
|
676
679
|
// Stop listening when the timer fires
|
|
677
680
|
// This will finish the current task and emit the final result (or a no-speech event)
|
|
678
681
|
await self?.stopListening()
|
|
679
|
-
|
|
680
682
|
}
|
|
681
683
|
}
|
|
682
684
|
}
|