Skip to content

Releases: jamsch/expo-speech-recognition

v56.0.1

Choose a tag to compare

@github-actions github-actions released this 05 Jun 02:48
e1cfce0

Patch Changes

  • e3f0fdf: Fix getSupportedLocales and androidTriggerOfflineModelDownload double-resolve issue for Android when called multiple times.
  • Type breakages: androidTriggerOfflineModelDownload() has a renamed status enum (from download_canceled to download_scheduled).

v56.0.0

Choose a tag to compare

@jamsch jamsch released this 17 May 05:12
fd030c1

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

Choose a tag to compare

@github-actions github-actions released this 22 Apr 13:56
b7d02cc

Patch Changes

  • 8c06f3e: Removed tvOS from the podspec, as Speech API is not available there

v3.1.2

Choose a tag to compare

@github-actions github-actions released this 20 Mar 13:49
f8eb26c

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

Choose a tag to compare

@github-actions github-actions released this 24 Feb 11:10
a5f8138

Patch Changes

  • 356a4d7: (iOS) Fixed a crash on audio route changes when the audio input node isn't ready

v3.1.0

Choose a tag to compare

@github-actions github-actions released this 27 Jan 01:40
fb86fef

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 end event:
    {
      "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 error event alongside the end event:
    {
      "error": "interrupted",
      "message": "Audio session was interrupted"
    }

v3.0.1

Choose a tag to compare

@github-actions github-actions released this 26 Nov 22:34
1ef7a00

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

Choose a tag to compare

@github-actions github-actions released this 07 Nov 02:37
9cba0dc

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-recognition library.
    Instead you'll now need to call the function directly from ExpoSpeechRecognitionModule.

    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

Choose a tag to compare

@github-actions github-actions released this 29 Sep 04:59
7ff939a

Patch Changes

  • 9010d14: Android: Use VOICE_RECOGNITION audio source input by default and harden the record loop to gracefully handle read errors

v2.1.4

Choose a tag to compare

@github-actions github-actions released this 22 Sep 07:07
5ce5691

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.code from the error event. For Android, you can import the SpeechRecognizerErrorAndroid enum to match against this code.

    Error codes with the value of -1 are thrown by this library and not by the SpeechRecognizer.

    Example use case: differentiating between ERROR_NETWORK and ERROR_NETWORK_TIMEOUT are currently mapped to network on event.error. With this change you can now use event.code to 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;
        }
      }
    });