software-mansion / software-mansion/react-native-audio-api
Feature request: DynamicsCompressorNode and/or a supported custom native node extension point
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 839
- Forks
- 92
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 27
Description
Feature request
DynamicsCompressorNode is currently ❌ in the Web Audio API coverage table, and there is no supported extension point for custom native DSP nodes. We'd love either (ideally both):
- A native
DynamicsCompressorNode(per the Web Audio spec), and/or - A supported native extension point for custom audio nodes (a stable C++ interface an external pod/gradle module can implement and insert into the graph).
Why WorkletProcessingNode doesn't cover this
We ship a sleep-audio app (long-form playback, screen locked) with a compressor/multiband/limiter chain implemented as a well-tested TypeScript kernel. We first ran it through createWorkletProcessingNode, and found it isn't realtime-viable for non-trivial DSP in release builds:
WorkletProcessingNode::processNoderuns the worklet synchronously on the audio render thread viaexecuteOnRuntimeSyncfor every 128-frame quantum (~2.7 ms @ 48 kHz), and allocates JS array views per call.- Under Hermes (interpreted in release, no JIT) plus runtime-lock/GC contention, a real multiband kernel misses render deadlines; the resulting periodic buffer glitches are audible as harsh distortion — worse with each additional worklet node. A trivial pass-through worklet is fine; real DSP is not.
So today the practical ceiling for WorkletProcessingNode is light-duty processing, and there's no native path for anything heavier.
What we can contribute
We have a platform-free TS reference implementation (single + multiband compressor with LR4 crossovers, brickwall envelope limiter) with sample-exact unit tests and deterministic parity vectors. If a native DynamicsCompressorNode or a custom-node interface lands, we're happy to help validate against those vectors, and could potentially contribute an implementation if maintainers are open to it.
Thanks for the library — the FFmpeg file source and the native graph have been excellent for us.
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
The issue names WorkletProcessingNode::processNode and createWorkletProcessingNode as entry points, plus a platform-free TypeScript reference implementation with unit tests and parity vectors. Start by locating the native audio graph and those worklet paths; done would be a native DynamicsCompressorNode or a stable C++ extension point validated against the supplied vectors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, react-native, typescript
- Domain
- api, audio-video-rtc
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100