Evade CORS restriction in examples, and put note on self-hosting file.

This commit is contained in:
msqr1
2024-05-13 23:18:32 -07:00
parent 748b73bdb3
commit 5b053e1047
5 changed files with 20 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.2/Vosklet.js" async defer></script>
<script src="Vosklet.js" async defer>
// Has to host this file on your own server, because Worker constructor doesn't allow CDN
</script>
<script>
async function start() {
// Make sure sample rate matches that in the training data
@@ -17,7 +19,7 @@
}))
// Load Vosklet module, model and recognizer
let module = await loadVosklet()
let model = await module.createModel("https://github.com/msqr1/Vosklet/raw/main/examples/en-model.tgz","model","ID")
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 => {