microsoft / microsoft/onnxruntime
[Web] Running onnxruntime in an audio worklet
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 179
Description
Describe the issue
I'm unable to start an inference session in an audio worklet context. I'm not sure what all of the obstacles to getting onnxruntime working in that context but I think the current build system may assume there is a global object called "self" that doesn't exist in that context. There are also other unusual characteristics of that context, some of which are documented here.
To reproduce
Here is a repo with my best attempt to run onnxruntime-web in an audio worklet. I end up with this error in the console
Error: no available backend found. ERR: [wasm] TypeError: o.cpus is not a function worklet.js line 19 > eval:85:11
Urgency
No response
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
"onnxruntime-web": "^1.12.1"
Execution Provider
WASM
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked onnx-audio-worklet-issue reproduction and worklet.js around line 19, using onnxruntime-web 1.12.1 with the WASM execution provider. Investigate the reported "no available backend" and "o.cpus is not a function" errors in the AudioWorklet context; done means an inference session starts successfully there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- machine-learning, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100