├── .editorconfig
├── .eslintrc.json
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .jshintrc
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── LICENSE
├── README.md
├── demo
├── README-logo.png
├── index.html
├── index_annyang.html
├── sample_sites
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ └── 4.jpg
└── speechkitt-demo.gif
├── dist
├── speechkitt.min.js
└── themes
│ ├── basic.css
│ ├── basic.css.map
│ ├── flat-amethyst.css
│ ├── flat-amethyst.css.map
│ ├── flat-clouds.css
│ ├── flat-clouds.css.map
│ ├── flat-concrete.css
│ ├── flat-concrete.css.map
│ ├── flat-emerald.css
│ ├── flat-emerald.css.map
│ ├── flat-midnight-blue.css
│ ├── flat-midnight-blue.css.map
│ ├── flat-orange.css
│ ├── flat-orange.css.map
│ ├── flat-pomegranate.css
│ ├── flat-pomegranate.css.map
│ ├── flat-pumpkin.css
│ ├── flat-pumpkin.css.map
│ ├── flat-turquoise.css
│ ├── flat-turquoise.css.map
│ ├── flat.css
│ └── flat.css.map
├── docs
└── README.md
├── package-lock.json
├── package.json
├── src
└── speechkitt.js
├── test
├── SpecRunner.html
├── helper_functions.js
├── init_corti.js
├── spec
│ ├── .jshintrc
│ ├── 1_BasicSpec.js
│ ├── 2_UISpec.js
│ └── 3_FunctionalSpec.js
└── vendor
│ ├── annyang.min.js
│ ├── corti.js
│ ├── jasmine-jquery.js
│ └── jquery-2.1.4.min.js
├── themes
├── basic.scss
├── flat-amethyst
│ └── flat-amethyst.scss
├── flat-clouds
│ └── flat-clouds.scss
├── flat-concrete
│ └── flat-concrete.scss
├── flat-emerald
│ └── flat-emerald.scss
├── flat-midnight-blue
│ └── flat-midnight-blue.scss
├── flat-orange
│ └── flat-orange.scss
├── flat-pomegranate
│ └── flat-pomegranate.scss
├── flat-pumpkin
│ └── flat-pumpkin.scss
├── flat-turquoise
│ └── flat-turquoise.scss
└── flat
│ └── flat.scss
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # http://editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 | indent_style = space
9 | indent_size = 2
10 | end_of_line = lf
11 | charset = utf-8
12 | trim_trailing_whitespace = true
13 | insert_final_newline = true
14 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "node": true
5 | },
6 | "extends": [
7 | "eslint:recommended"
8 | ],
9 | "parserOptions": {
10 | "sourceType": "module"
11 | },
12 | "rules": {
13 | "no-console": 0,
14 | "indent": [
15 | "error",
16 | 2
17 | ],
18 | "linebreak-style": [
19 | "error",
20 | "unix"
21 | ],
22 | "quotes": [
23 | "error",
24 | "single"
25 | ],
26 | "semi": [
27 | "error",
28 | "always"
29 | ]
30 | },
31 | "globals": {
32 | "annyang": false
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | demo/* linguist-documentation
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Expected Behavior
4 |
5 |
6 |
7 | ## Current Behavior
8 |
9 |
10 |
11 | ## Possible Solution
12 |
13 |
14 |
15 | ## Steps to Reproduce (for bugs)
16 |
17 |
18 | 1.
19 | 2.
20 | 3.
21 | 4.
22 |
23 | ## Context
24 |
25 |
26 |
27 | ## Your Environment
28 |
29 | * Version used:
30 | * Browser Name and version:
31 | * Operating System and version (desktop or mobile):
32 | * Link to your project:
33 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Motivation and Context
7 |
8 |
9 |
10 | ## How Has This Been Tested?
11 |
12 |
13 |
14 |
15 | ## Screenshots (if appropriate):
16 |
17 | ## Types of changes
18 |
19 | - [ ] Bug fix (non-breaking change which fixes an issue)
20 | - [ ] New feature (non-breaking change which adds functionality)
21 | - [ ] Breaking change (fix or feature that would cause existing functionality to change)
22 |
23 | ## Checklist:
24 |
25 |
26 | - [ ] My code follows the code style of this project.
27 | - [ ] My change requires a change to the documentation.
28 | - [ ] I have updated the documentation accordingly.
29 | - [ ] I have read the **CONTRIBUTING** document.
30 | - [ ] I have added tests to cover my changes.
31 | - [ ] All new and existing tests passed.
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .grunt
3 | .idea
4 | test/coverage
5 | .sass-cache
6 | .DS_Store
7 | npm-debug.log
8 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node" : true,
3 | "browser" : true,
4 | "devel" : false,
5 | "camelcase" : true,
6 | "curly" : true,
7 | "latedef" : true,
8 | "unused" : true,
9 | "trailing" : true,
10 | "eqeqeq" : true,
11 | "eqnull" : true,
12 | "evil" : false,
13 | "forin" : true,
14 | "immed" : true,
15 | "laxbreak" : false,
16 | "newcap" : true,
17 | "noarg" : true,
18 | "noempty" : false,
19 | "nonew" : true,
20 | "onevar" : false,
21 | "plusplus" : false,
22 | "undef" : true,
23 | "sub" : true,
24 | "strict" : true,
25 | "white" : false,
26 | "indent" : 2,
27 | "globals": {
28 | "annyang": false
29 | }
30 | }
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '10'
4 | - '8'
5 | - '6'
6 | - 'node'
7 | before_script:
8 | - gem update --system
9 | - gem install sass
10 | - 'npm install -g grunt-cli'
11 | - 'grunt'
12 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Speech KITT
2 |
3 | Thank you for taking the time to get involved with Speech KITT! :+1:
4 |
5 | There are several ways you can help the project out:
6 |
7 | * [Contributing code](#contributing-code)
8 | * [Reporting Bugs](#reporting-bugs)
9 | * [Feature Requests and Ideas](#feature-requests-and-ideas)
10 |
11 | ## How Can I Contribute?
12 |
13 | ### Contributing Code
14 |
15 | - [x] Fork the repository from the [Speech KITT GitHub page](https://github.com/TalAter/SpeechKITT).
16 | - [x] Clone a copy to your local machine with `$ git clone git@github.com:YOUR-GITHUB-USER-NAME/SpeechKITT.git`
17 | - [x] Make sure you have *node.js* and *npm* installed on your machine. You can use this [guide](https://docs.npmjs.com/getting-started/installing-node) for help.
18 | - [x] Install all of Speech KITT's development dependencies with npm. `$ cd SpeechKITT; npm install`
19 | - [x] Run grunt to make sure everything runs smoothly `$ grunt`
20 | - [x] Add tests for your code. [See details below](#automated-testing).
21 | - [x] Code, code, code.
22 | - [x] Run `$ grunt` after making changes to verify that everything still works and run the build process. Alternatively, you can just run `$ grunt watch` once, and leave that process running. It will continuously run all the tests and build the files every time you make a change to one of Speech KITT's files. It will even *beep* if you make an error, and help you debug it.:+1:
23 | - [x] Before committing your changes, the last step must always be running `$ grunt`. This makes sure everything works, and all files are kept up to date with your changes.
24 | - [x] Once you've made sure all your changes work correctly and have been committed, push your local changes back to github with `$ git push -u origin master`
25 | - [x] Visit your fork on GitHub.com ([https://github.com/YOUR-USER-NAME/SpeechKITT](https://github.com/YOUR-USER-NAME/SpeechKITT)) and create a pull request for your changes.
26 | - [x] Makes sure your pull request describes exactly what you changed and if it relates to an open issue references that issue (just include the issue number in the title like this: #49)
27 |
28 | #### Important:
29 |
30 | * Make sure to run `npm install` and `grunt` and make sure all tasks completed successfully before committing.
31 | * Do not change the [API docs](https://github.com/TalAter/SpeechKITT/blob/master/docs/README.md) in `/docs/README.md` directly. This file is generated automatically, and your changes will be overwritten. Instead, update the relevant comments in speechkitt.js
32 | * If you make any changes, please make sure to test your changes thoroughly to make sure no backward functionality was broken, and that your changes work as intended.
33 | * Do not update the version number yourself.
34 | * Please stick to the project's existing coding style. Coding styles don't need to have a consensus, they just need to be consistent :smile:.
35 | * Push your changes to a topic branch in your fork of the repository. Your branch should be based on the `master` branch.
36 | * When submitting [pull request](https://help.github.com/articles/using-pull-requests/), please elaborate as much as possible about the change, your motivation for the change, etc.
37 |
38 | #### Automated Testing
39 |
40 | Speech KITT is tested using [Jasmine](http://jasmine.github.io/2.0/introduction.html).
41 |
42 | Please include tests for any changes you make:
43 | * If you found a bug, please write a test that fails because of that bug, then fix the bug so that the test passes.
44 | * If you are adding a new feature, write tests that thoroughly test every possible use of your code.
45 | * If you are changing existing functionality, make sure to update existing tests so they pass. (This is a last resort. Whenever possible try to maintain backwards compatibility)
46 |
47 | The tests reside in *BasicSpec.js* and *UISpec.js*. These file contains a series of spec groups (e.g. `describe('a spec group', function() {});`) which each contain 1 or more specs (e.g. `it('should do stuff', function() {});`). Some of the spec groups also contain some code which runs before each spec (`beforeEach(function() {});`). When adding a test you can usually find the appropriate file to add your tests to by looking at existing tests for similar functionality.
48 |
49 | To simulate Speech Recognition in the testing environment, Speech KITT uses a mock object called [Corti](https://github.com/TalAter/Corti) which mocks the browser's SpeechRecognition object. Corti also adds a number of utility functions to the SpeechRecognition object which simulate user actions (e.g. `say('Hello there')`), and allow checking the SpeechRecognition's status (e.g. `isListening() === true`).
50 |
51 | ### Reporting Bugs
52 |
53 | Bugs are tracked as [GitHub issues](https://github.com/TalAter/SpeechKITT/issues). If you found a bug with Speech KITT, the quickest way to get help would be to look through existing open and closed [GitHub issues](https://github.com/TalAter/SpeechKITT/issues?q=is%3Aissue). If the issue is already being discussed and hasn't been resolved yet, you can join the discussion and provide details about the problem you are having. If this is a new bug, please open a [new issue](https://github.com/TalAter/SpeechKITT/issues/new).
54 |
55 | When you are creating a bug report, please include as many details as possible.
56 |
57 | Explain the problem and include additional details to help maintainers reproduce the problem.
58 |
59 | * Use a clear and descriptive title for the issue to identify the problem.
60 | * Describe the exact steps which reproduce the problem. Share the relevant code to reproduce the issue if possible.
61 | * Try to isolate the issue as much as possible, reducing unrelated code until you get to the minimal amount of code in which the bug still reproduces. This is the most important step to help the community solve the issue.
62 |
63 | ### Feature Requests and Ideas
64 |
65 | We track discussions of new features, proposed changes and other ideas as [GitHub issues](https://github.com/TalAter/SpeechKITT/issues). If you would like to discuss one of those, please first look through existing open and closed [GitHub issues](https://github.com/TalAter/SpeechKITT/issues?q=is%3Aissue) and see if there is already a discussion on this topic which you can join. If there isn't, please open a [new issue](https://github.com/TalAter/SpeechKITT/issues/new).
66 |
67 | When discussing new ideas or proposing changes, please take the time to be as descriptive as possible about the topic at hand. Please take the time to explain the issue you are facing, or the problem you propose to solve in as much detail as possible.
68 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | "use strict";
3 |
4 | // Project configuration.
5 | grunt.initConfig({
6 | pkg: grunt.file.readJSON('package.json'),
7 | jshint: {
8 | all: [
9 | 'src/speechkitt.js',
10 | 'Gruntfile.js',
11 | 'test/corti.js',
12 | 'test/spec/*Spec.js'
13 | ],
14 | options: {
15 | jshintrc: true
16 | }
17 | },
18 | uglify: {
19 | dist: {
20 | options: {
21 | output: {
22 | comments: /^\! /
23 | }
24 | },
25 | files: {
26 | 'dist/speechkitt.min.js': ['src/speechkitt.js']
27 | }
28 | }
29 | },
30 | watch: {
31 | files: ['src/speechkitt.js', 'test/*.js', 'test/spec/**.js', 'themes/**/*', '!**/node_modules/**'],
32 | tasks: ['default']
33 | },
34 | sass: {
35 | dist: {
36 | options: {
37 | style: 'compressed'
38 | },
39 | files: {
40 | 'dist/themes/flat.css': 'themes/flat/flat.scss',
41 | 'dist/themes/flat-amethyst.css': 'themes/flat-amethyst/flat-amethyst.scss',
42 | 'dist/themes/flat-clouds.css': 'themes/flat-clouds/flat-clouds.scss',
43 | 'dist/themes/flat-concrete.css': 'themes/flat-concrete/flat-concrete.scss',
44 | 'dist/themes/flat-emerald.css': 'themes/flat-emerald/flat-emerald.scss',
45 | 'dist/themes/flat-midnight-blue.css': 'themes/flat-midnight-blue/flat-midnight-blue.scss',
46 | 'dist/themes/flat-orange.css': 'themes/flat-orange/flat-orange.scss',
47 | 'dist/themes/flat-pomegranate.css': 'themes/flat-pomegranate/flat-pomegranate.scss',
48 | 'dist/themes/flat-pumpkin.css': 'themes/flat-pumpkin/flat-pumpkin.scss',
49 | 'dist/themes/flat-turquoise.css': 'themes/flat-turquoise/flat-turquoise.scss',
50 | 'dist/themes/basic.css': 'themes/basic.scss'
51 | }
52 | }
53 | },
54 | markdox: {
55 | target: {
56 | files: [
57 | {src: 'src/speechkitt.js', dest: 'docs/README.md'}
58 | ]
59 | }
60 | },
61 | jasmine: {
62 | testAndCoverage: {
63 | src: ['src/speechkitt.js'],
64 | options: {
65 | specs: ['test/spec/*Spec.js'],
66 | outfile: 'test/SpecRunner.html',
67 | polyfills: ['test/vendor/corti.js', 'test/init_corti.js', 'test/vendor/annyang.min.js', 'test/helper_functions.js'],
68 | vendor: ['test/vendor/jquery-2.1.4.min.js', 'test/vendor/jasmine-jquery.js'],
69 | styles: ['dist/themes/basic.css'],
70 | keepRunner: true,
71 | template: require('grunt-template-jasmine-istanbul'),
72 | templateOptions: {
73 | coverage: 'test/coverage/coverage.json',
74 | report: [
75 | {
76 | type: 'html',
77 | options: {
78 | dir: 'test/coverage'
79 | }
80 | },
81 | {
82 | type: 'text'
83 | }
84 | ],
85 | thresholds: {
86 | lines: 50,
87 | statements: 50,
88 | branches: 50,
89 | functions: 50
90 | }
91 | }
92 | }
93 | }
94 | }
95 | });
96 |
97 | // Load NPM Tasks
98 | grunt.loadNpmTasks('grunt-contrib-uglify');
99 | grunt.loadNpmTasks('grunt-contrib-jshint');
100 | grunt.loadNpmTasks('grunt-contrib-jasmine');
101 | grunt.loadNpmTasks('grunt-contrib-watch');
102 | grunt.loadNpmTasks('grunt-contrib-sass');
103 | grunt.loadNpmTasks('grunt-markdox');
104 |
105 | // Default task(s).
106 | grunt.registerTask('default', ['jshint', 'uglify', 'sass', 'jasmine', 'markdox']);
107 |
108 | // Test task
109 | grunt.registerTask('test', ['jshint', 'jasmine']);
110 |
111 | };
112 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Tal Ater
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Speech KITT
2 |
3 |
4 | > A flexible GUI for interacting with Speech Recognition
5 |
6 | Speech KITT makes it easy to add a GUI to sites using Speech Recognition. Whether you are using [annyang](https://github.com/TalAter/annyang), a different library or webkitSpeechRecognition directly, KITT will take care of the GUI.
7 |
8 | Speech KITT provides a graphical interface for the user to start or stop Speech Recognition and see its current status. It can also help guide the user on how to interact with your site using their voice, providing instructions and sample commands. It can even be used to carry a natural conversation with the user, asking questions the user can answer with his voice, and then asking follow up questions.
9 |
10 | Speech KITT is fully customizable, and comes with many different themes (and instructions on how to create your own designs).
11 |
12 | [](https://github.com/TalAter/SpeechKITT)
13 |
14 |
15 | ## Hello World
16 |
17 | The most basic implementation requires 6 commands.
18 |
19 | 1. Let KITT know how to start and stop the SpeechRecognition engine you use with `SpeechKITT.setStartCommand()` and `SpeechKITT.setAbortCommand`.
20 | 2. Add events to your SpeechRecognition engine so it calls `SpeechKITT.onStart()` when it starts, and `SpeechKITT.onEnd()` when it stops.
21 | 3. Tell KITT which stylesheet to use for its GUI with `SpeechKITT.setStylesheet()` (KITT comes with a number of pre-made [styles](https://github.com/TalAter/SpeechKITT/tree/master/dist/themes)).
22 | 4. Start your engines with `SpeechKITT.vroom()`
23 |
24 | ````html
25 |
26 |
48 | ````
49 |
50 | ## Hello World - With annyang
51 |
52 | If you're doing [Speech Recognition with annyang](https://www.talater.com/annyang/), you can skip most of the configuration above. Just calling `SpeechKITT.annyang()` will take care of the configuration explained in steps 1 & 2 above.
53 |
54 | ````html
55 |
56 |
57 |
74 | ````
75 |
76 | ## API Docs
77 |
78 | For details on all available methods, options and more details, check out the [API documentation](https://github.com/TalAter/SpeechKITT/blob/master/docs/README.md).
79 |
80 | ## Pretty Badges
81 |
82 | [](https://travis-ci.org/TalAter/SpeechKITT)
83 |
84 | ### Author
85 |
86 | Tal Ater: [@TalAter](https://twitter.com/TalAter)
87 |
88 | ### License
89 |
90 | Licensed under [MIT](https://github.com/TalAter/SpeechKITT/blob/master/LICENSE).
91 |
--------------------------------------------------------------------------------
/demo/README-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TalAter/SpeechKITT/082dc7323074e581c1937dfb042a5511030c0b44/demo/README-logo.png
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |