Skip to content

new setup for custom processor #562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

mdydek
Copy link
Contributor

@mdydek mdydek commented Jul 16, 2025

Closes RNAA-173, RNAA-138, RNAA-175

⚠️ Breaking changes ⚠️

Introduced changes

  • deleted custom processor class from our codebase
  • added docs, script for generating boiler plate code and infrastructure in lib to support implementing custom processors using turbo modules
  • updated readme with next npm tag deletion

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

@mdydek mdydek changed the title feat: new setup new setup for custom processor Jul 21, 2025
@mdydek mdydek marked this pull request as ready for review July 22, 2025 14:23
@mdydek mdydek requested a review from michalsek July 22, 2025 14:23
Comment on lines +167 to +171
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
${ROOT}/shared/NativeAudioProcessingModule.cpp
${ROOT}/shared/MyProcessorNode.cpp
${ROOT}/shared/MyProcessorNodeHostObject.cpp
)
Copy link
Member

Choose a reason for hiding this comment

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

highlight? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used highlight to indicate changes when comparing with generated files, I think it could be misleading if I would highlight only this part. Also highlighting whole file is a no go for me.

}
const oscillator = audioContextRef.current.createOscillator();
// constructor is put in global scope
const processor = new MyProcessorNode(audioContextRef.current, global.createCustomProcessorNode(audioContextRef.current.context));
Copy link
Member

Choose a reason for hiding this comment

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

hmm, would it make sense to wrap the call to global.create in a function exported somewhere? :)

import { createCustomProcessorNode } from './creator';
const processor = createCustomProcessorNode(audioContextRef.current);

Copy link
Member

Choose a reason for hiding this comment

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

Also you're using most of the nodes through useRef, while the processor is used directly, either do not use the refs at all or use it for the processor too. (The first option is preferred)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with a wrapper, but for the sake of simplicity and minimal code example, would this be needed? To me it would introduce unnecessary overhead.

@mdydek mdydek added the development Develop some feature or integrate it with sth label Jul 23, 2025

This comment has been minimized.

This comment has been minimized.

@mdydek mdydek force-pushed the feat/arch-for-custom-processor branch from 1f6af72 to 7bc81ca Compare July 23, 2025 12:22

This comment has been minimized.

@mdydek mdydek added the documentation Improvements or additions to documentation label Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Develop some feature or integrate it with sth documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants