JavaScript 語音識別庫:JuliusJS

jopen 10年前發布 | 37K 次閱讀 JuliusJS JavaScript開發

用于Web的語音識別庫

在線示例:live demo.

JuliusJS is an opinionated port of Julius to JavaScript.
It actively listens to the user to transcribe what they are saying through a callback.

// bootstrap JuliusJS
var julius = new Julius();

julius.onrecognition = function(sentence) {
    console.log(sentence);
};

// say "Hello, world!"
// console logs: `> HELLO WORLD`

特性:

  • Real-time transcription
    • Use the provided grammar, or write your own
  • 100% JavaScript implementation
    • All recognition is done in-browser through a Worker
    • Familiar event-inspired API
    • No external server calls

Quickstart

Using Express 4.0
  1. Grab the latest version with bower
    • bower install juliusjs --save
  2. Include julius.js in your html
    • <script src="julius.js"></script>
  3. Make the scripts available to the client through your server

    var express = require('express'),
        app     = express();
    
    app.use(express.static('path/to/dist'));
  4. In your main script, bootstrap JuliusJS and register an event listener for recognition events

    // bootstrap JuliusJS
    var julius = new Julius();
    
    // register listener
    julius.onrecognition = function(sentence, score) {
        // ...
        console.log(sentence);
    };
  • Your site now has real-time speech recognition baked in!

項目主頁:http://www.baiduhome.net/lib/view/home/1412597629562

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!