Skip to content

Getting started

Live demo, needs a microphone.Open full screen ↗
  1. Install it.

    Terminal window
    npx expo install expo-stt

    On iOS it compiles, but speech recognition has not been tested on a device yet.

  2. Add the config plugin. Both texts are optional.

    app.json
    {
    "expo": {
    "plugins": [
    ["expo-stt", {
    "microphonePermission": "Dictate notes",
    "speechRecognitionPermission": "Turn speech into text"
    }]
    ]
    }
    }
  3. Build the app. The module has native code, so it does not run in Expo Go.

    Terminal window
    npx expo run:ios
    npx expo run:android
  4. Listen.

    import { listen, SpeechError } from 'expo-stt';
    try {
    const { transcript } = await listen();
    } catch (error) {
    console.warn(SpeechError.from(error).code);
    }

Expo SDK 58 or newer: iOS 16.4, Android 7, or a browser with the Web Speech API.

Install Expo modules, add NSMicrophoneUsageDescription and NSSpeechRecognitionUsageDescription to Info.plist, and run npx pod-install. Android needs no configuration.

You want Use
One phrase: a search, an answer listen()
A screen that shows what is said useSpeechRecognition()
A button to hold while talking useHoldToTalk()
Full control outside of React start(), addListener()