Releases: jamsch/expo-speech-recognition
Release list
v56.0.1
Patch Changes
- e3f0fdf: Fix
getSupportedLocalesandandroidTriggerOfflineModelDownloaddouble-resolve issue for Android when called multiple times. - Type breakages:
androidTriggerOfflineModelDownload()has a renamed status enum (fromdownload_canceledtodownload_scheduled).
v56.0.0
Major Changes
e6a5ce6: Add support for Expo SDK 56. From SDK 56, versioning for this library will change to be in line with Expo versioning. So this means for Expo 56, you can now install expo-speech-recognition ^56.0.0 and in the future, install 57.0.0 when SDK 57 comes out.
With this version, the minimum iOS version has also been increased from 13.4 to 16.4.
v3.1.3
Patch Changes
- 8c06f3e: Removed tvOS from the podspec, as Speech API is not available there
v3.1.2
Patch Changes
- 5f3bd93: Avoid restarting the iOS audio engine during audio route changes while the app
is leaving the foreground, which could still crash some speech-recognition
sessions after the 3.1.1 input-node readiness fix.
v3.1.1
Patch Changes
- 356a4d7: (iOS) Fixed a crash on audio route changes when the audio input node isn't ready
v3.1.0
Minor Changes
-
b14dcc3: (iOS) Added support for handling audio interruptions and route changes on iOS. With these changes this means:
- When the audio route changes (e.g. a bluetooth headset connects), this library will try to switch the recording microphone and keep speech recognition active.
- If this fails, you'll receive the following error alongside the
endevent:
- If this fails, you'll receive the following error alongside the
{ "error": "audio-capture", "message": "Audio route changed and failed to restart the audio engine" }- When receiving an interruption (e.g. phone call, Siri, alarm), you'll receive this
errorevent alongside theendevent:
{ "error": "interrupted", "message": "Audio session was interrupted" } - When the audio route changes (e.g. a bluetooth headset connects), this library will try to switch the recording microphone and keep speech recognition active.
v3.0.1
Patch Changes
-
7a64d6e: (iOS) Allow passing through folder URIs for audio persistence.
You can now do the following on Android and iOS:
import { ExpoSpeechRecognitionModule } from "expo-speech-recognition"; import { Directory, Paths } from "expo-file-system"; const outputDirectory = new Directory(Paths.join(Paths.cache, "recordings")); // Create the folder, if it doesn't exist yet (Android does not yet create intermediates) outputDirectory.create({ intermediates: true, idempotent: true }); // Start speech recognition with a custom directory ExpoSpeechRecognitionModule.start({ lang: "en-US", recordingOptions: { persist: true, // e.g. "file:///data/user/0/com.yourapp.app/cache/recordings/" outputDirectory: outputDirectory.uri, }, });
v3.0.0
Major Changes
Official support for Expo 54
-
3b48113: With this major version change, we've removed some top-level exports from the base
expo-speech-recognitionlibrary.
Instead you'll now need to call the function directly fromExpoSpeechRecognitionModule.The list of removed exports:
// Removed import { getSupportedLocales } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.getSupportedLocales();
// Removed import { getSpeechRecognitionServices } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.getSpeechRecognitionServices();
// Removed import { supportsOnDeviceRecognition } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.supportsOnDeviceRecognition();
// Removed import { supportsRecording } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.supportsRecording();
// Removed import { setCategoryIOS } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.setCategoryIOS({ ... });
// Removed import { getAudioSessionCategoryAndOptionsIOS } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.getAudioSessionCategoryAndOptionsIOS();
// Removed import { setAudioSessionActiveIOS } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.setAudioSessionActiveIOS(true, { ... });
// Removed import { androidTriggerOfflineModelDownload } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.androidTriggerOfflineModelDownload({ ... });
// Removed import { isRecognitionAvailable } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.isRecognitionAvailable();
// Removed import { getDefaultRecognitionService } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.getDefaultRecognitionService();
// Removed import { getAssistantService } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.getAssistantService();
// Removed import { addSpeechRecognitionListener } from "expo-speech-recognition"; // Instead use: ExpoSpeechRecognitionModule.addListener("foo", (event) => { ... });
v2.1.5
Patch Changes
- 9010d14: Android: Use
VOICE_RECOGNITIONaudio source input by default and harden the record loop to gracefully handle read errors
v2.1.4
Patch Changes
-
a3aef4e: Add native event error codes for Android.
For advanced use cases where you'd like to debug the platform's underlying speech recognizer you can now access
event.codefrom the error event. For Android, you can import theSpeechRecognizerErrorAndroidenum to match against this code.Error codes with the value of
-1are thrown by this library and not by theSpeechRecognizer.Example use case: differentiating between
ERROR_NETWORKandERROR_NETWORK_TIMEOUTare currently mapped tonetworkonevent.error. With this change you can now useevent.codeto see the exact error that was thrown.import { SpeechRecognizerErrorAndroid, useSpeechRecognitionEvent, } from "expo-speech-recognition"; useSpeechRecognitionEvent("error", (event) => { if (Platform.OS === "android") { switch (event.code) { case SpeechRecognizerErrorAndroid.ERROR_NETWORK: break; case SpeechRecognizerErrorAndroid.ERROR_NETWORK_TIMEOUT: break; case -1: // An error usually thrown by this library break; } } });