-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f26db62
commit f9a565c
Showing
8 changed files
with
63 additions
and
115 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
class MyWasmProcessor extends AudioWorkletProcessor { | ||
constructor(options) { | ||
super(); | ||
|
||
console.log("options.processorOptions:", options.processorOptions); | ||
|
||
let [module, foobar] = options.processorOptions; | ||
|
||
// Fetch, compile, and instantiate the WebAssembly module | ||
WebAssembly.instantiateStreaming(module) | ||
.then(results => { | ||
// `results` is an object with both the module and its instance | ||
console.log('WebAssembly module instantiated successfully'); | ||
|
||
// Exported functions can now be called | ||
const exports = results.instance.exports; | ||
// const result = exports.yourExportedFunction(); | ||
// console.log('Result from your function:', result); | ||
|
||
console.log("exports:", exports); | ||
}) | ||
.catch(error => { | ||
console.error('Error instantiating WebAssembly module:', error); | ||
}); | ||
} | ||
process(inputs, outputs, parameters) { | ||
// TODO: send it over a channel to a regular worker? i'm stumped and just want it working even if it isn't real time | ||
|
||
// TODO: this seems to be ignored | ||
return true; | ||
|
||
// return this.processor.process(inputs[0][0]); | ||
} | ||
} | ||
|
||
registerProcessor("my-wasm-processor", MyWasmProcessor); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters