Add documents and optimize build
This commit is contained in:
23
src/processor.js
Normal file
23
src/processor.js
Normal file
@@ -0,0 +1,23 @@
|
||||
registerProcessor("wasmMemCpy", class extends AudioWorkletProcessor {
|
||||
constructor(options) {
|
||||
super(options)
|
||||
this.retval = true
|
||||
this.port.onmessage = (ev) => {
|
||||
switch(ev.cmd) {
|
||||
case "init":
|
||||
this.ptr = ev.ptr
|
||||
this.wasmMem = ev.wasmMem
|
||||
this.recognizerPort = ev.ports[0]
|
||||
break
|
||||
case "deinit":
|
||||
this.retval = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
process(input, output, param) {
|
||||
const data = input[0][0]
|
||||
this.recognizerPort.postMessage("done")
|
||||
return this.retval
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user