Skip to content

refactor: integrated DSPAudioBuffer and DSPAudioArray into codebase#985

Open
maciejmakowski2003 wants to merge 3 commits intorefactor/aligned-audio-arrayfrom
refactor/aligned-data-structures-integration
Open

refactor: integrated DSPAudioBuffer and DSPAudioArray into codebase#985
maciejmakowski2003 wants to merge 3 commits intorefactor/aligned-audio-arrayfrom
refactor/aligned-data-structures-integration

Conversation

@maciejmakowski2003
Copy link
Collaborator

@maciejmakowski2003 maciejmakowski2003 commented Mar 12, 2026

Closes #

⚠️ Breaking changes ⚠️

Introduced changes

  • Integrated AlignedAudioArray and AlignedAudioBuffer template instantiations into codebase.
  • Replaced CircularAudioArray with CircularArray template class

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the audio processing pipeline to standardize on SIMD-friendly DSPAudioBuffer/DSPAudioArray types and modernizes supporting utilities (circular buffers, resampler) across iOS, Android, core DSP, tests, and documentation/templates.

Changes:

  • Replace many AudioBuffer/AudioArray processing paths with DSPAudioBuffer/DSPAudioArray equivalents across nodes and DSP utilities.
  • Replace legacy CircularAudioArray with a templated CircularArray utility and migrate includes/usages.
  • Convert the r8brain resampler wrapper to a header-only Resampler.hpp and update call sites; refresh tests/docs/templates accordingly.

Reviewed changes

Copilot reviewed 94 out of 94 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/react-native-audio-api/ios/audioapi/ios/core/utils/IOSRecorderCallback.mm Update circular buffer include to new header
packages/react-native-audio-api/ios/audioapi/ios/core/utils/IOSRecorderCallback.h Remove obsolete forward declaration
packages/react-native-audio-api/ios/audioapi/ios/core/IOSAudioRecorder.mm Update circular buffer include to new header
packages/react-native-audio-api/ios/audioapi/ios/core/IOSAudioPlayer.mm Switch render callback/buffer to DSPAudioBuffer
packages/react-native-audio-api/ios/audioapi/ios/core/IOSAudioPlayer.h Switch render callback/buffer to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/sources/ConstantSourceTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/sources/AudioScheduledSourceTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/effects/WaveShaperNodeTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/effects/StereoPannerTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/effects/GainTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/test/src/core/effects/DelayTest.cpp Update tests to use DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/utils/CircularAudioArray.h Remove legacy circular audio array header
packages/react-native-audio-api/common/cpp/audioapi/utils/CircularAudioArray.cpp Remove legacy circular audio array implementation
packages/react-native-audio-api/common/cpp/audioapi/utils/CircularArray.hpp Add templated circular array replacement
packages/react-native-audio-api/common/cpp/audioapi/utils/AudioBuffer.hpp Allow cross-alignment copy/sum; keep aliases
packages/react-native-audio-api/common/cpp/audioapi/utils/AudioArrayBuffer.hpp Adjust alignment template + test dummy base
packages/react-native-audio-api/common/cpp/audioapi/utils/AudioArray.hpp Fix typo; keep DSP/standard aliases
packages/react-native-audio-api/common/cpp/audioapi/dsp/r8brain/Resampler.hpp Add header-only resampler wrapper
packages/react-native-audio-api/common/cpp/audioapi/dsp/r8brain/Resampler.h Remove legacy resampler header
packages/react-native-audio-api/common/cpp/audioapi/dsp/r8brain/Resampler.cpp Remove legacy resampler implementation
packages/react-native-audio-api/common/cpp/audioapi/dsp/WaveShaper.h Switch processing buffers to DSPAudioArray
packages/react-native-audio-api/common/cpp/audioapi/dsp/WaveShaper.cpp Switch internal temps + processing to DSPAudioArray
packages/react-native-audio-api/common/cpp/audioapi/dsp/FFT.h Generalize FFT APIs to aligned arrays
packages/react-native-audio-api/common/cpp/audioapi/dsp/Convolver.h Switch processing buffers to DSPAudioArray
packages/react-native-audio-api/common/cpp/audioapi/dsp/Convolver.cpp Switch internal buffers + processing to DSPAudioArray
packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioRecorderCallback.h Include new circular array header; cleanup decls
packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioRecorderCallback.cpp Update circular buffer include to new header
packages/react-native-audio-api/common/cpp/audioapi/core/sources/WorkletSourceNode.h Switch node processing to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/WorkletSourceNode.cpp Switch node processing to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/StreamerNode.h Switch resampler include + processing to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/StreamerNode.cpp Switch processing + internal buffer to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/RecorderAdapterNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/RecorderAdapterNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/OscillatorNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/OscillatorNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/ConstantSourceNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/ConstantSourceNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.h Update updatePlaybackInfo buffer type
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioScheduledSourceNode.cpp Update updatePlaybackInfo buffer type
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.h Switch processing + rate/audio buffers to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferSourceNode.cpp Switch processing signatures; adjust buffer lifecycle notes
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.h Switch processing signatures to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferQueueSourceNode.cpp Switch processing signatures to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferBaseSourceNode.h Switch playback rate buffer to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioBufferBaseSourceNode.cpp Initialize playback rate buffer as DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/inputs/AudioRecorder.h Remove obsolete forward declaration
packages/react-native-audio-api/common/cpp/audioapi/core/inputs/AudioRecorder.cpp Minor cleanup in includes/formatting
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WorkletProcessingNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WorkletProcessingNode.cpp Switch processing signature; adjust time type
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WorkletNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WorkletNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WaveShaperNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/WaveShaperNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/StereoPannerNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/StereoPannerNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/PeriodicWave.h Switch wavetable storage to DSP types
packages/react-native-audio-api/common/cpp/audioapi/core/effects/PeriodicWave.cpp Switch band-limited tables to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/IIRFilterNode.h Switch processing signature + indices array to DSP
packages/react-native-audio-api/common/cpp/audioapi/core/effects/IIRFilterNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/GainNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/GainNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/DelayNode.h Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/DelayNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.h Switch internal/intermediate buffers + processing to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/ConvolverNode.cpp Switch internal/intermediate buffers + processing to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/effects/BiquadFilterNode.h Switch delay line arrays to DSPAudioArray
packages/react-native-audio-api/common/cpp/audioapi/core/effects/BiquadFilterNode.cpp Switch processing signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/destinations/AudioDestinationNode.h Switch render/process signatures to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/destinations/AudioDestinationNode.cpp Switch render signature to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/analysis/AnalyserNode.h Switch analysis buffers to DSP types + new circular array
packages/react-native-audio-api/common/cpp/audioapi/core/analysis/AnalyserNode.cpp Switch analysis buffers to DSP types + new circular array
packages/react-native-audio-api/common/cpp/audioapi/core/OfflineAudioContext.h Add DSP render buffer + const members
packages/react-native-audio-api/common/cpp/audioapi/core/OfflineAudioContext.cpp Use persistent DSP render buffer; copy into result
packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h Remove now-unneeded AudioBuffer include
packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.cpp Update circular buffer include to new header
packages/react-native-audio-api/common/cpp/audioapi/core/AudioParam.h Switch a-rate processing buffers to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/AudioParam.cpp Allocate/process a-rate params using DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/AudioNode.h Switch node processing pipeline to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/AudioNode.cpp Allocate/process node buffers using DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/AudioContext.h Update render callback type to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/core/AudioContext.cpp Update render callback type to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/HostObjects/sources/AudioBufferSourceNodeHostObject.cpp Switch internal buffers to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/WaveShaperNodeHostObject.cpp Update curve handling to AudioArray copy
packages/react-native-audio-api/common/cpp/audioapi/HostObjects/effects/ConvolverNodeHostObject.cpp Switch internal buffers to DSPAudioBuffer
packages/react-native-audio-api/common/cpp/audioapi/AudioAPIModuleInstaller.h Fix exported JS prop name for createAudioBuffer
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/utils/AndroidRecorderCallback.h Remove obsolete forward declaration
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/utils/AndroidRecorderCallback.cpp Update circular buffer include to new header
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/AudioPlayer.h Switch render callback/buffer to DSPAudioBuffer
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/AudioPlayer.cpp Switch render callback/buffer to DSPAudioBuffer
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/AndroidAudioRecorder.h Remove obsolete forward declaration
packages/react-native-audio-api/android/src/main/cpp/audioapi/android/core/AndroidAudioRecorder.cpp Update circular buffer include to new header
packages/custom-node-generator/templates/basic/shared/MyProcessorNode.h Update template node signature to DSPAudioBuffer
packages/custom-node-generator/templates/basic/shared/MyProcessorNode.cpp Update template node signature to DSPAudioBuffer
packages/audiodocs/docs/guides/create-your-own-effect.mdx Update docs example to DSPAudioBuffer signatures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants