Repository navigation
fix(audio-context): Android audio-rate biquad and listener params, real convolution, oscillator frequency automation - #287
Merged
Conversation
…al convolution, oscillator frequency automation - ConvolverNode convolves: uniformly partitioned FFT convolution a quantum per partition (no latency), built off the audio thread from the buffer's native channels; spec normalization honouring `normalize`; 1, 2 and 4-channel responses; silent with no buffer. - BiquadFilterNode frequency, Q, gain and detune are gain-style params: they take automation and audio, and coefficients are computed per frame when they vary (spec formulas, lowpass/highpass Q in dB). - AudioListener params take audio; every panner of the context reads it. - Oscillator and constant source automation is scheduled against its context, so audio connected to OscillatorNode.frequency matches the automated value. - createBufferSource() without a buffer no longer opens a Java AudioTrack per node; those leaked AudioFlinger tracks until later realtime contexts could not open a stream. - Specs: Android skips removed; convolver and listener specs added.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
ℹ️ Note: npm publishing is disabled for pull requests. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Android
@nativescript/audio-contextgaps that the audio specs skipped. All of the fixes are in the native graph (audio_graph.cpp) and its Java glue.ConvolverNode convolves. It used to pass its input straight through. It now does uniformly partitioned FFT convolution with one 128-frame partition per quantum, so it adds no latency (
convolver.cpp).normalizeapplies the spec's equal-power scale and is read when the buffer is set, as the spec says.BiquadFilterNode params take audio and automation.
frequency,Q,gainanddetuneare now gain-style params in the engine. Before,setValueAtTimeand similar calls set the value immediately, and connected audio was ignored.AudioListener params take audio. Audio connected to a listener param is summed into it every frame, and every panner in that context reads it.
OscillatorNode.frequency automation. Oscillator and constant-source ids were never tied to their context, so their
setValueAtTimeand ramp events were dropped. Audio connected tofrequencywas summed correctly, but the automated reference never changed, so the two drifted apart. Those events are now scheduled.Realtime contexts going silent. The cause was not the splitter disconnect.
createBufferSource()without a buffer fell back to opening a JavaAudioTrackfor each node. Those tracks leaked until AudioFlinger ran out (no more tracks available), and later realtime contexts then failed to open a stream (AAUDIO_ERROR_INTERNAL). A source created without a buffer now just gets an id in its context's engine.Specs: the four Android skips are removed. New specs cover:
AudioListener.positionXagainst automationPixel 9 Pro emulator,
audiosuite: 66/66 passing.