1.1.0 • Published 11 months ago

@lite-v3/speech-to-text v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

@lite-v3/lite-speech-to-text

Basic utility package to convert speech input to text input

By Tokopedia Version

Installation

Install deps

# Use pnpm
pnpm add @lite-v3/speech-to-text

# Use npm
npm i @lite-v3/lite-speech-to-text

# Use yarn
yarn add @lite-v3/lite-speech-to-text

Hooks

useSpeechToText

React hook to use the browser speechRecognition's API

Usage

useSpeechToText

import { useSpeechToText } from '@lite-v3/speech-to-text';

const { listening, startListening, abortListening } = useSpeechToText({
  lang: 'id-ID',
  isListeningAnything: false,
  onSpeechEnd: handleSpeechEnd,
});

const handleSpeechIconClick = () => {
  if (!listening) {
    startListening();
  } else {
    abortListening();
  }
};

return <div onClick={handleSpeechIconClick} />;

Code By WPE Team @Tokopedia

1.1.0

11 months ago

1.0.0

11 months ago

1.0.0-beta-1

11 months ago