Skip to content
Projetos

Sobre

Speech to text for Expo, with one small API on iOS, Android and web: dictation, voice search, hold to talk and live volume.

Desenvolvimento web e de aplicativos

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
Coletando histórico
em 15 dias
Coletando histórico
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

expo-stt

English | Tiếng Việt

Speech to text for Expo, with one small API that behaves the same on iOS, Android and web.

Documentation with live demos and copyable code →

import { listen } from 'expo-stt';

const { transcript } = await listen({ locale: 'en-US' });

What you see is what you get

Each demo is one file in example/scenes/. The documentation runs that file and prints it: copy it, and you have what you saw.

Voice notes
Voice notes

Dictation that survives pauses: it keeps listening until you stop it.
Voice search
Voice search

One phrase, one await: the result of listen() goes into the search field.
Hold to talk
Hold to talk

Hold to speak, release to send, slide left to cancel.
Voice commands
Voice commands

A smart home that tries every alternative until one makes sense.
Hands-free form
Hands-free form

Asks one question after the other, with a plain for loop.
Pronunciation
Pronunciation

Words light up while you read them, then you get a score.

Install

npx expo install expo-stt

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

{ "expo": { "plugins": ["expo-stt"] } }

Expo SDK 58 or newer, in a development build. Not in Expo Go.

Browsers

Browser Speech recognition
Chrome, Edge Works right away. Chrome sends the audio to Google
Firefox Asks to download a language pack first, then works
Others getCapabilities().recognition tells. Without it, start() and listen() reject with service-unavailable

The page needs HTTPS or localhost.

Use

import { useSpeechRecognition } from 'expo-stt';

function Dictation() {
  const { transcript, isActive, toggle, error } = useSpeechRecognition({ continuous: true });

  return (
    <>
      <Text>{transcript}</Text>
      {error && <Text>{error.code}</Text>}
      <Button title={isActive ? 'Stop' : 'Speak'} onPress={() => void toggle()} />
    </>
  );
}
You want Use
One phrase listen()
A screen that shows what is said useSpeechRecognition()
A button to hold while talking useHoldToTalk()
A waveform useSpeechVolume()
Full control outside of React start(), stop(), abort(), addListener()

API · Platforms · Migrating from 0.x · Architecture · Contributing

License

MIT © Tuan Nguyen Anh

Explore projetos relacionados

Carregando…