react-hook-text-to-speech
v1.0.10
Published
Easy to use simple react hook for converting text into speech
Downloads
13
Maintainers
Readme
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]