Speechless is a library to make working with Web Speech API on the web easier. It provides a consistent API for speech to text in different browsers, in the situation that the API is not available yet you can supply a fallback to your own speech to text API.
Why
- Save money and use native speech-to-text recognition
- Hide the complexity with a simple interface
- Easy events
- 100% test and coverage
- Types for better development
Demo
TypeDocs
https://puemos.github.io/speechless
Install
$ npm i speechless --save
$ yarn add speechless
Usage
; // Create event listeners // Fallback function for remote call recognition // Create new instance // Connect the listenersrecognition.addEventListener'end', onEndrecognition.addEventListener'data', onDatarecognition.addEventListener'fetching', onFetchingrecognition.addEventListener'stop', onStoprecognition.addEventListener'start', onStart // Start listeningrecognition.listen
Events
'start'
Event function () {}
Emitted on successful recognition start
'end'
Event function () {}
Emitted after successful recognition end
'stop'
Event function () {}
Emitted after a force stop.
'fetching'
Event function () {}
Emitted when the the audio is being sent to 3-rd party service
'data'
Event function (event) {}
Emitted when the new recognition data is avialible
event.detail === 'hello world'
Contributing
Speechless is an OPEN Open Source Project. This means that:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit.
Contributors
Shy Alter | GitHub/puemos | Twitter/@puemos |
---|
License
MIT