Skip to content
المشاريع

حول

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

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

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

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…