add examples/Vosklet.js, a slightly modified file to make the examples work with the current setup.

This commit is contained in:
msqr1
2024-05-24 12:27:34 -07:00
parent ef010940bc
commit 76aedbdfee
10 changed files with 49 additions and 19 deletions

22
examples/Vosklet.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.3/Vosklet.min.js" async defer></script>
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.3/examples/Vosklet.min.js" async defer></script>
<script>
async function start() {
async function start(spkModel = false) {
// Make sure sample rate matches that in the training data
let ctx = new AudioContext({sampleRate : 16000})
// Setup mic with correct sample rate
@@ -19,7 +19,7 @@
// Load Vosklet module, model and recognizer
let module = await loadVosklet()
let model = await module.createModel("https://raw.githubusercontent.com/msqr1/Vosklet/main/examples/en-model.tgz","model","ID")
let recognizer = await module.createRecognizer(model, 16000)
// Listen for result and partial result
recognizer.addEventListener("result", ev => {
console.log("Result: ", ev.detail)

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.3/Vosklet.min.js" async defer></script>
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.3/examples/Vosklet.min.js" async defer></script>
<script>
async function start() {
// Make sure sample rate matches that in the training data

View File

@@ -1 +0,0 @@
I have no idea how to do this. HELP!