useSpeech

React 用户界面钩子,用于合成说出给定字符串的人声。

useSpeech - 图1

用法

  1. import {useSpeech} from 'react-use';
  2. const Demo = () => {
  3. const state = useSpeech('Hello world!');
  4. return (
  5. <pre>
  6. {JSON.stringify(state, null, 2)}
  7. </pre>
  8. );
  9. };