A simple react component to deal with browser SpeechRecognition
Install the module via npm.
npm install react-speech
Than import the script and the style to your project:
import ReactSpeech from 'react-speech';
import 'react-speech/build/css/index.css'
Now you can use the react-speech component everywhere in your application:
<ReactSpeech onText={(t) => console.log(t)} />
For more informations about the SpeechRecognition API visit the official page.
- lang: The language of the current SpeechRecognition. If not specified, this defaults to the HTML lang attribute value, or the user agent's language setting if that isn't set either.
- onText: Called when a word or phrase has been positively recognized and this has been communicated back to the app.
Clone the project repository, than install the dependencies and run:
npm run start
this will fire up the grunt development environment with a http server and actions on file changes, than when you have done your editing you can run:
npm run build
to package the project to be ready for production.
The react-speech is released under the MIT License by codekraft-studio.
- Fork it ( https://github.com/codekraft-studio/react-speech/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Write and run the tests (
npm run test
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request