|
Download react-use/docs/useSpeech.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 390 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useSpeech.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/docs/useSpeech.md
-
curl -L -o useSpeech.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/docs/useSpeech.md
390 Bytes
useSpeech
React UI hook that synthesizes human voice that speaks a given string.
Usage
import {useSpeech} from 'react-use';
const voices = window.speechSynthesis.getVoices();
const Demo = () => {
const state = useSpeech('Hello world!', { rate: 0.8, pitch: 0.5, voice: voices[0] });
return (
<pre>
{JSON.stringify(state, null, 2)}
</pre>
);
};