Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.58 KB

useSystemVoices.md

File metadata and controls

45 lines (31 loc) · 1.58 KB

useSystemVoices

A side effect to retrieve all the available system voices using the Web_Speech_API.

Why? 💡

Basic Usage:

import { List, Title } from 'beautiful-react-ui';
import useSystemVoices from 'beautiful-react-hooks/useSystemVoices'; 

const SpeechSynthesisDemo = () => {
  const voices  = useSystemVoices();

  return (
   <DisplayDemo>
     <Title size="lg">System voices</Title> 
     <List condensed>
        {voices.map(({ name, lang }) => <List.Item key={name}>{name} - <small>{lang}</small></List.Item>)}
     </List>
   </DisplayDemo>
  );
};

<SpeechSynthesisDemo />

Mastering the hooks

✅ When to use

  • When you need to easily get all the system languages from the Web_Speech_API.

🛑 When not to use

  • In production...yet. This is still an experimental feature