Skip to content
A simple JavaScript library for text-to-speech and speech recognition using www.voicerss.org's API. Inspired from Tal Ater's annyang.js
JavaScript CSS
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
css
fonts Fixed fonts
img Fixed demo page
node_modules Minified using uglifyks
LICENSE
README.md
favicon.png
index.html
jarvis.js
jarvis.min.js

README.md

.jarvis.js

.jarvis.js or Point Jarvis is a simple JavaScript library for speech recognition and text-to-speech using www.voicerss.org's API. Inspired from Tal Ater's annyang.js and Iron Man. View demo

Why is the name Point Jarvis?

Because this is just a part of Jarvis. Much like a part of 1: .1 .2 .3 .12312. There you go.

Usage

<!-- [CDN hosted at jsdelivr.net](http://cdn.jsdelivr.net/jarvis.js/1.0.0/jarvis.min.js) -->
<script src="jarvis.min.js"></script>
<script>
    //set your voice key, you can get it from www.voicerss.org
    jarvis.setVoiceKey('814690c9d02c4c15be28146ee9f6ac27');

    //set things to learn, array of arrays
    jarvis.learn([
        // 1st parameter is the command (string/regex)
        // 2nd parameter is the function to execute
        ["show me :name", function(name){
            console.log('name');
            jarvis.speak('clear ' + name);
        }]
    ]);

    //set name, if you don't want the name jarvis
    jarvis.setName('Raven');

    // if you want to require the name for every command
    // e.g. command "show me" will only match to "Jarvis show me"
    // defaults to false
    jarvis.reqname(true);

    // onrecognize will give you the recognized speech
    jarvis.onrecognize = function(text){
        // do what you want ...
    };

    // onnomatch will be triggered if the text didn't match any of commands
    jarvis.onnomatch = function(text){
        // do what you want ...
    };

    // debug if you want to debug things
    // defaults to false
    jarvis.debug = true;

    // speak commands jarvis to say things
    // has a limit of 100 characters
    jarvis.speak = true;

    //wake up jarvis
    jarvis.start();

    //put jarvis to sleep
    jarvis.stop();
</script>

**For more details, send me a message rjlagrimas08@gmail.com

Author

Raven Lagrimas | rjlagrimas08@gmail.com

To Do

  1. Documentation the code.
  2. Minify.
  3. Bower support.
  4. Demo page.
  5. Improve TTS and STT.
  6. Be popular.
  7. Stay Awesome. :white_check_mark:

License

Licensed under MIT

Something went wrong with that request. Please try again.