Skip to content

Conversation

@maciejmakowski2003
Copy link
Collaborator

@maciejmakowski2003 maciejmakowski2003 commented Dec 29, 2025

Closes #

⚠️ Breaking changes ⚠️

Introduced changes

  • Enhanced communication between JS thread and Audio thread. All node's modifications from JS thread are scheduled on CrossThreadEventScheduler wrapper to be executed on Audio thread. HostObject plays a ShadowAudioNode role - it stores a copy of node's state.

Read: Simply read HostObject state
Write: Schedule modification and modify Shadow State

Lock free approach!!!

TODO:

  • AudioNode creation guide
  • test AudioPlayer on Android

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

audioBufferSourceNode->setLoop(value.getBool());
auto loop = value.getBool();

auto event = [audioBufferSourceNode, loop](BaseAudioContext &context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need reference to context here and in all of the lambdas that they do not use context inside it? if not change sfinae definition of a function so more types can be passed in event scheduler

: nodeManager_(std::make_shared<AudioNodeManager>()),
: sampleRate_ {sampleRate},
nodeManager_(std::make_shared<AudioNodeManager>()),
audioEventScheduler_(std::make_unique<CrossThreadEventScheduler<BaseAudioContext>>(1024)),
Copy link
Contributor

Choose a reason for hiding this comment

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

magic number, put it in some constant

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.

4 participants