• Stars
    star
    187
  • Rank 199,937 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

***DEPRECATED*** Want to control an AngularJS app using voice commands? Check it.

This repository is deprecated!


adaptive-speech v0.3.0 Build Status

This module allows you to control web app using voice commands. It's based on Chrome's speech recognition API.

Demo

Check out http://angular-adaptive.github.io/adaptive-speech/demo/

References

We recomend you to read:

Requirements

  • AngularJS v ~1.2.x

Usage

We use bower for dependency management. Add

dependencies: {
    "angular-adaptive-speech": "latest"
}

To your bower.json file. Then run

bower install

This will copy the speech recognition files into your bower_components folder, along with its dependencies. Load the script files in your application:

<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/angular-adaptive-speech/angular-adaptive-speech.min.js"></script>

Add the adaptive.speech module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['adaptive.speech']);

and include $speechRecognition, $speechSynthetis, $speechCorrection service as a dependency to your controller:

angular.module('MyApp').controller('MainCtrl', function ['$scope', '$speechRecognition, $speechSynthetis', ($scope, $speechRecognition, $speechSynthetis) {

}]);

To start speech recognition run from controller:

$speechRecognition.onstart(function(){
  $speechSynthetis.speak('Yes? How can I help you?', 'en-UK');
});
$speechRecognition.setLang('en-UK'); // Default value is en-US
$speechRecognition.listen();

Apply the directive to your elements where reference is keyword reference:

<ul>
    <li ng-repeat="todo in todos | filter:statusFilter track by $index" speechrecognition="{'tasks': recognition['en-US']['listTasks'], 'reference': todo}">
        {{todo}}
    </li>
</ul>

Or run recognition directly from controller:

$speechRecognition.listenUtterance($scope.recognition['en-US']['addToList']);

Options

All the speechRecognition options can be set up in your controller.

myAppModule.controller('MyController', function($scope) {
    $scope.recognition = {};
    $scope.recognition['en-US'] = {
        'addToList': {
            'regex': /^to do .+/gi,
            'lang': 'en-US',
            'call': function(e){
                $scope.addToList(e);
            }
        },
        'listTasks': [{
            'regex': /^complete .+/gi,
            'lang': 'en-US',
            'call': function(e){
                $scope.completeTask(e);
            }
        },{
            'regex': /^remove .+/gi,
            'lang': 'en-US',
            'call': function(e){
                $scope.removeTask(e);
            }
        }]
    };
});

APIs

Check out API docs.

Testing

We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:

npm install -g grunt-cli
npm install
bower install
grunt

The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in test/test.config.js

Contributing

Pull requests are welcome.

Make a PR against canary branch and don't bump any versions.

Please respect the code style in place.

License

The MIT License

Copyright (c) 2014 Jan Antala

More Repositories

1

angular-qr

Dynamic QR code generator for AngularJS
JavaScript
209
star
2

GPS-distance

calculate distance between 2 GPS points
C
70
star
3

speech-synthesis

Speech Synthesis polyfill
JavaScript
69
star
4

qrcode.js

QR code generator, supports Numeric, Alphanumeric and Binary input mode
JavaScript
46
star
5

angular-adaptive-motion

***DEPRECATED*** Want to control an AngularJS app using your web cam? Check it.
JavaScript
44
star
6

angular-adaptive-scroll

***DEPRECATED*** Want to scroll in an AngularJS app using gyroscope? Check it.
JavaScript
32
star
7

codility

JS solutions to Codility tasks
JavaScript
32
star
8

love-heart

Pulsating love heart web component
17
star
9

Gyrocopter

Gyroscope Simulator - Extension for Chrome Developer Tools
JavaScript
14
star
10

handwriting-recognition

JavaScript
10
star
11

angular-isbn

ISBN input validation for AngularJS
6
star
12

information.js

Information retrieval npm module
JavaScript
4
star
13

genetic-css-minify

CSS minification based on genetic principes
JavaScript
3
star
14

epileptic-glass

Sample Node.js app for Google Glass using Mirror API.
3
star
15

local-tld-update

Update ~/.local-tld.json from node.js app
JavaScript
2
star
16

slides

A collection of my talk slides
JavaScript
2
star
17

dotfiles

Vim Script
1
star
18

arduino-lights

My Christmas decoration
Arduino
1
star
19

latex-seed

Basic structure for latex made documents
TeX
1
star
20

canvas-draw

Web component
JavaScript
1
star
21

cynickaobluda-notifier

Email notifications for a new meme at cynickaobluda.com
JavaScript
1
star
22

bank-bookmarklets

Bank login Bookmarklets‎.
JavaScript
1
star
23

beer-shelf

My beer shelf
1
star
24

o2-bookmarklet

O2 Charges calculator
JavaScript
1
star
25

github-reports

Explore GitHub contributions - reporting tool
JavaScript
1
star
26

senior-detection

HTML
1
star