JavaScript 语音识别库:JuliusJS
jopen
10年前
用于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 </ul> </li> </ul>
- Grab the latest version with bower
bower install juliusjs --save
- Include
julius.js
in your html<script src="julius.js"></script>
-
Make the scripts available to the client through your server
var express = require('express'), app = express(); app.use(express.static('path/to/dist'));
-
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!
Quickstart
Using Express 4.0
- All recognition is done in-browser through a