node-web-audio-api
node-web-audio-api copied to clipboard
`AudioWorklet` improvements
Remaining todos and ideas following #124
- [x] Review rules and fix number of channels outputs when input change
- [x] Use a pool of
Float32Array
channels to avoid allocation and GC (as much as possible) - [ ] Ensure we run
run_audio_worklet_global_scope
andsetImmediate
only once per render quantum - [ ] Use the fact that parameterDescriptors are ordered to avoid transferring parameter keys, i.e.
NapiAudioWorlketProcessor::param_values
could just beVec<&'static [f32]>
- [ ] Review how message passing is done between audio and worklet threads (possibly use
parking_lot
crate ?) - [ ] ~Dry run
process
functions to force the JIT compiler to optimize them ? (might break some wpt checks)~ could create issues If the worklet buffer some values - [ ] Review and annotate unsafe sections
- [ ] Change the thread_priority crate to https://github.com/mozilla/audio_thread_priority
- [ ] Use a CondVar instead of crossbeam channel for Worker/Rust message passing
- [ ] Propagate back error to rust thread in case of WorkletAbruptCompletionResult to remove the Worklet from graph
- [ ] ...