Potential fix for #7
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.4/examples/Vosklet.min.js" async defer></script>
|
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.4/examples/Vosklet.min.js" async defer></script>
|
||||||
<script>
|
<script>
|
||||||
async function start(spkModel = false) {
|
async function start() {
|
||||||
// Make sure sample rate matches that in the training data
|
// Make sure sample rate matches that in the training data
|
||||||
let ctx = new AudioContext({sampleRate : 16000})
|
let ctx = new AudioContext({sampleRate : 16000})
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.4/examples/Vosklet.min.js" async defer></script>
|
<script src="https://cdn.jsdelivr.net/gh/msqr1/Vosklet@1.0.4/examples/Vosklet.min.js" async defer></script>
|
||||||
<script>
|
<script>
|
||||||
async function start(spkModel = false) {
|
async function start() {
|
||||||
// Make sure sample rate matches that in the training data
|
// Make sure sample rate matches that in the training data
|
||||||
let ctx = new AudioContext({sampleRate : 16000})
|
let ctx = new AudioContext({sampleRate : 16000})
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ let processorURL = URL.createObjectURL(new Blob(['(', (() => {
|
|||||||
this.buffer = new Float32Array(this.maxCount * 128)
|
this.buffer = new Float32Array(this.maxCount * 128)
|
||||||
}
|
}
|
||||||
process(inputs) {
|
process(inputs) {
|
||||||
|
if(!inputs[0][0]) return true
|
||||||
this.buffer.set(inputs[0][0], this.count * 128)
|
this.buffer.set(inputs[0][0], this.count * 128)
|
||||||
this.count++
|
this.count++
|
||||||
if(this.count >= this.maxCount) {
|
if(this.count >= this.maxCount) {
|
||||||
|
|||||||
Reference in New Issue
Block a user