0.1.0 • Published 6 years ago

rc-transcribe-speech v0.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

rc-transcribe-speech

Uses the Web Speech API built into most modern browsers to transcribe spoken language.

Git repository

Installation

  • npm install --save rc-transcribe-speech

Usage

import TranscribeSpeech from 'rc-transcribe-speech'

Basic

<TranscribeSpeech
  onResult={ ({ interimTranscript, finalTranscript })=>{ console.log(finalTranscript) }
  continuous={ true }
/>

Speak into a microphone and the transcribed dictation will appear in the console.

Customizing with props

<TranscribeSpeech
  onStart={ ()=>{ console.log('speech started')} }
  onEnd={ ()=>{ console.log('speech ended')} }
  onResult={ ({ interimTranscript, finalTranscript })=>{ this.setState({ transcribedSpeech: finalTranscript })} }
  continuous={ true }
  lang="en-US"
  stop={ false /* NOTE a button could stop this.state.stop */ }
/>
<div>{ this.state.transcribedSpeech }</div>

To show text on the screen set state to the finalTranscript result using the onResult event.

Source

TODO

As an NPM module