Introduction
react-text-to-speech is an easy-to-use React.js component that leverages the Web Speech API to convert text to speech.
Features
- Text-to-speech
- Easy to use
- Highlights words as they are read. See highlighting text using useSpeech Hook and Speech Component
- Provides API to handle errors and events. See Handling Errors and Events
- Handles multiple speech instances easily. See handling using useSpeech Hook and Speech Component
- Fully Customizable. See useSpeech Hook Usage and usage with FaC
- Stops speech instance on component unmount.
Installation
Install react-text-to-speech
using:
- npm
- yarn
- pnpm
- bun
npm install react-text-to-speech --save
yarn add react-text-to-speech
pnpm add react-text-to-speech
bun add react-text-to-speech
Usage
react-text-to-speech offers two main ways to integrate text-to-speech functionality into your React.js applications.