1.4.1 • Published 4 months ago

react-text-to-speech v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

react-text-to-speech

An easy-to-use React.js component that leverages the Web Speech API to convert text to speech.

Features

Installation

Install react-text-to-speech using your preferred package manager:

# Using npm:
npm install react-text-to-speech --save

# Using Yarn:
yarn add react-text-to-speech

# Using pnpm:
pnpm add react-text-to-speech

# Using Bun:
bun add react-text-to-speech

Usage

react-text-to-speech provides two primary methods to integrate text-to-speech functionality into your React.js applications: the useSpeech hook and the <Speech> component.

useSpeech Hook

Basic Usage

import React from "react";
import { useSpeech } from "react-text-to-speech";

export default function App() {
  const {
    Text, // Component that renders the processed text
    speechStatus, // Current speech status
    isInQueue, // Indicates whether the speech is currently playing or waiting in the queue
    start, // Starts or queues the speech
    pause, // Pauses the speech
    stop, // Stops or removes the speech from the queue
  } = useSpeech({ text: "This library is awesome!" });

  return (
    <div style={{ display: "flex", flexDirection: "column", rowGap: "1rem" }}>
      <Text />
      <div style={{ display: "flex", columnGap: "0.5rem" }}>
        {speechStatus !== "started" ? <button onClick={start}>Start</button> : <button onClick={pause}>Pause</button>}
        <button onClick={stop}>Stop</button>
      </div>
    </div>
  );
}

Detailed Usage

For more details on using the useSpeech hook, refer to the documentation.

<Speech> Component

Basic Usage

import React from "react";
import Speech from "react-text-to-speech";

export default function App() {
  return <Speech text="This library is awesome!" />;
}

Detailed Usage

For more details on using the <Speech> component, refer to the documentation.

Demo

Check out the live demo to see it in action.

Documentation

Explore the documentation to get started quickly.

Contribute

Show your ❤️ and support by giving a ⭐ on GitHub. You can also support the project by upvoting and sharing it on Product Hunt. Any suggestions are welcome! Take a look at the contributing guide.

License

This project is licensed under the MIT License.

1.2.0

6 months ago

1.2.5

4 months ago

1.2.4

4 months ago

1.2.3

5 months ago

1.2.2

5 months ago

1.2.1

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.1.2

6 months ago

1.0.2

6 months ago

1.0.1

7 months ago

1.0.0

7 months ago

1.4.1

4 months ago

1.4.0

4 months ago

1.0.3

6 months ago

1.3.1

4 months ago

1.3.0

4 months ago

0.17.0

10 months ago

0.18.0

9 months ago

0.19.0

9 months ago

0.19.1

9 months ago

0.19.2

9 months ago

0.19.3

9 months ago

0.19.4

8 months ago

0.19.5

8 months ago

0.16.3

10 months ago

0.14.7

1 year ago

0.14.8

1 year ago

0.14.9

1 year ago

0.15.0

1 year ago

0.15.1

1 year ago

0.15.2

1 year ago

0.15.3

1 year ago

0.16.0

1 year ago

0.16.1

1 year ago

0.16.2

12 months ago

0.14.6

1 year ago

0.14.5

1 year ago

0.14.4

1 year ago

0.14.3

1 year ago

0.14.2

1 year ago

0.14.0

1 year ago

0.14.1

1 year ago

0.13.3

1 year ago

0.13.4

1 year ago

0.13.5

1 year ago

0.13.1

1 year ago

0.13.2

1 year ago

0.13.0

1 year ago

0.12.10

1 year ago

0.12.9

1 year ago

0.12.7

1 year ago

0.12.8

1 year ago

0.12.6

1 year ago

0.12.1

1 year ago

0.12.2

1 year ago

0.12.3

1 year ago

0.12.4

1 year ago

0.12.5

1 year ago

0.11.0

1 year ago

0.12.0

1 year ago

0.10.0

1 year ago

0.9.7

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

0.9.2

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.0

1 year ago

0.9.1

1 year ago

0.8.15

1 year ago

0.8.14

1 year ago

0.8.13

1 year ago

0.8.12

1 year ago

0.8.9

1 year ago

0.8.11

1 year ago

0.8.10

1 year ago

0.8.8

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.8.1

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.0

1 year ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.7

1 year ago

0.6.8

1 year ago

0.6.6

1 year ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.5.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.9

2 years ago

0.3.14

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

2 years ago

0.2.0-beta

3 years ago

0.3.0

3 years ago

0.1.0-beta

3 years ago

0.1.7-beta

3 years ago

0.1.6-beta

3 years ago

0.1.5-beta

3 years ago

0.1.4-beta

3 years ago

0.1.3-beta

3 years ago

0.1.2-beta

3 years ago

0.1.1-beta

3 years ago

0.1.0-beta.0

3 years ago