1.3.1 • Published 7 years ago

speechtotextjs v1.3.1

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

SpeechToTextJs

Single Library for Client Side Speech Detection

This library is based on html5's Web Speech API, Currently following browsers support SpeechRecognition

  • Chrome

Usage

  • NPM : npm install speechtotextjs --save
  • Bower : bower install speechtotextjs --save

Or linking script files

<script type="text/javascript" src="../dist/SpeechToTextJs.min.js"></script>

Sample Code

Please see the demo folder for working solution

    var speecht2text = new SpeechToText(function(){
    			speecht2text.setIsContinous(true);
    			speecht2text.setAllowInterimResults(true);
    			speecht2text.setMaxAlternatives(20);

    			var lang = speecht2text.getAllSupportedLanguages();
    			speecht2text.setLanguage((lang[0]).key);  // english

    			speecht2text.start();

    			speecht2text.onEnd(function () {
    				alert(speecht2text.getText());
    			});

    			setTimeout(function(){
    				speecht2text.stop();
    			},5000);
    		},function () {
    			alert("Browser Not Supported");
    		});

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Bug fixes and new features can be proposed using pull requests. Please read the contribution guidelines before submitting a pull request.

Credits

License

The MIT License (MIT). Please see License File for more information.