|
1 | 1 | # Overview
|
2 |
| -- A lightweight, up to date speech recognizer in the browser with total brotlied (used by JSDelivr) size of **under a megabyte** (616 KB) |
| 2 | +- A fast, lightweight, actively maintained speech recognizer in the browser with total brotlied (used by JSDelivr) size of **under a megabyte** (614 KB) |
3 | 3 | - Live Demo (ASR in 20 languages): https://msqr1-github-io.pages.dev/Vosklet
|
4 | 4 | - Inspired by [vosk-browser](https://github.com/ccoreilly/vosk-browser)
|
5 | 5 |
|
|
12 | 12 | - Include model cache path management
|
13 | 13 | - Include model cache ID management (for updates)
|
14 | 14 | - Wraps all Vosk's functionaly
|
15 |
| -- Faster than vosk-browser |
| 15 | +- Faster and lighter than vosk-browser |
16 | 16 |
|
17 | 17 | # Basic usage (microphone recognition in English)
|
18 | 18 | - Using JsDelivr CDN
|
|
23 | 23 | <!DOCTYPE html>
|
24 | 24 | <html>
|
25 | 25 | <head>
|
26 |
| - < script src= "https://cdn.jsdelivr.net/gh/msqr1/[email protected].0/Examples/Vosklet.js" async defer></ script> |
| 26 | + < script src= "https://cdn.jsdelivr.net/gh/msqr1/[email protected].1/Examples/Vosklet.js" async defer></ script> |
27 | 27 | <script>
|
28 | 28 | async function start() {
|
29 | 29 | // All data is collected and transfered to the main thread so the AudioContext won't output anything. Set sinkId type to none to save power
|
|
41 | 41 |
|
42 | 42 | // Load Vosklet module, model and recognizer
|
43 | 43 | let module = await loadVosklet();
|
44 |
| - let model = await module.createModel("https://ccoreilly.github.io/vosk-browser/models/vosk-model-small-en-us-0.15.tar.gz","English","vosk-model-small-en-us-0.15") |
| 44 | + let model = await module.createModel("https://ccoreilly.github.io/vosk-browser/models/vosk-model-small-en-us-0.15.tar.gz","English","vosk-model-small-en-us-0.15"); |
45 | 45 | let recognizer = await module.createRecognizer(model, ctx.sampleRate);
|
46 | 46 |
|
47 | 47 | // Listen for result and partial result
|
48 |
| - recognizer.addEventListener("result", ev => console.log("Result: ", ev.detail)) |
| 48 | + recognizer.addEventListener("result", ev => console.log("Result: ", ev.detail)); |
49 | 49 | recognizer.addEventListener("partialResult", ev => console.log("Partial result: ", ev.detail));
|
50 | 50 |
|
51 | 51 | // Create a transferer node to get audio data on the main thread
|
|
0 commit comments