react-hook-text-to-speech

1.0.10 • Public • Published

react-hook-text-to-speech

react-hook-text-to-speech is a React hook ,which helps to convert any text to audio.

Installation

npm i react-hook-text-to-speech

Demo

import useTextToSpeech from 'react-hook-text-to-speech'
import {useState} from 'react';

function App() {
  const [text,setText]=useState('');
  const convert=useTextToSpeech();

  return (
    <div className="App">
      <input onChange={(e)=>setText(e.target.value)}/>
      <button onClick={()=>convert(text)}>click</button>
    </div>
  );
}

export default App;

Usage

Arguments of convert function

convert(Text,Speed,Volume)

Arguments Data type
Text string
Speed Number -> 0 to 1 (Optional)
Volume Number -> 0 to 1 (Optional)

License

[ISC]

Package Sidebar

Install

npm i react-hook-text-to-speech

Weekly Downloads

4

Version

1.0.10

License

ISC

Unpacked Size

1.91 kB

Total Files

3

Last publish

Collaborators

  • aruncv