Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-say

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-say

A React component that synthesis text into speech using Web Speech API

  • 0.0.1-master.9a3a7ab
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.3K
increased by6.99%
Maintainers
1
Weekly downloads
 
Created
Source

react-say

npm version Build Status

A React component that synthesis text into speech using Web Speech API.

This project scaffold can be found at compulim/react-component-template.

Demo

Try out the demo at https://compulim.github.io/react-say/.

How to use

First, run npm install react-say for production build. Or run npm install react-say@master for latest development build.

Simple scenario

The following will speak the text immediately upon showing up. Some browsers may not speak the text until the user interacted with the page.

import BasicSay from 'react-say';

export default props =>
  <BasicSay
    text="A quick brown fox jumped over the lazy dogs."
  />

Customizing pitch/rate

You may want to customize the speech by varying pitch and rate. You can use <Composer> and <Say> to say your text.

import { Composer, Say } from 'react-say';

export default props =>
  <Composer>
    <Say
      pitch={ 1.1 }
      rate={ 1.5 }
      text="A quick brown fox jumped over the lazy dogs."
    />
  </Composer>

Note: variation will take effect for new/modified <Say>

Say button

Since some browsers may block speak synthesis before the user interacting with the page, you can use <SayButton> for the purpose.

import { Composer, SayButton } from 'react-say';

export default props =>
  <Composer>
    <SayButton
      onClick={ event => console.log(event) }
      text="A quick brown fox jumped over the lazy dogs."
    >
      Tell me a story
    </SayButton>
  </Composer>

Contributions

Like us? Star us.

Want to make it better? File us an issue.

Don't like something you see? Submit a pull request.

FAQs

Package last updated on 09 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc