Angular Easy Voice
Is a voice command library.
Installation
bower install angular-easy-voice --save
Add dependencies to the section of your main html:
<script src="bower_components/angular-easy-voice/dist/EasyVoice.min.js"></script>
Add module
MODULE NAME: 'angular-easy-voice';
angular.module('myApp', ['angular-easy-voice'])
.controller('myCtrl', function('$scope', EasyVoice){
console.log(EasyVoice);
});
Basic usage
EasyVoice.initWatch('Ok Google', {
lang: 'pt-BR',
debug: false
}, false);
Stop
EasyVoice.stopWatch();
Example Simple Command
EasyVoice.addCommand('hello', function(){
console.log('hello my friend!');
});
##Example Start-based command
EasyVoice.addCommandStartingWith('Search people', function(text){
console.log(text)
});
Example Speech
EasyVoice.reproduce('Hello my friend.', 'en-US');
#Add words
EasyVoice.addWord("Gumga");
#Translate
EasyVoice.setTranslate({
speakNow: 'Speak Now',
notUnderstand : 'Not understand.',
tryAgain : 'Try again.',
checkMicrophone: 'Please, check your microphone.',
listening: 'listening...'
});
Installation of dependencies for use or development
npm install
Tasks
Run the task 'npm run dev' for the development.
Run the task 'npm run prod' generating the minified file.