1.1.0 • Published 11 months ago

react-voice-handler v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

const App: React.FC = () => { const commands = { command: 'hello', action: () => alert('Hello there!') }, { command: '안녕하세요', action: () => alert('hello') }, { command: 'goodbye', action: () => alert('Goodbye!') }, ;

const { startRecognition, stopRecognition } = useVoiceCommands(commands, { continuous: true, lang: LangEnum.EnglishUS });

return ( <div> <h1>Voice Command App</h1> <button onClick={startRecognition}>Start Listening</button> <button onClick={stopRecognition}>Stop Listening</button> </div> ); };

export default App;

const { startRecognition, stopRecognition } = useVoiceCommands(commands, { onError: handleError });

1.1.0

11 months ago

1.0.0

11 months ago