Open
Conversation
poneciak57
requested changes
Feb 26, 2026
Collaborator
Author
maciejmakowski2003
left a comment
There was a problem hiding this comment.
The current core and native implementation skills structure lacks clear boundaries. I propose a more modular and rigorous split to ensure better maintainability.
- audio-nodes: how to implement c++ audio node, reference to thread safety skill, class hierarchy and characterictics,(possibly audio-param, but not sure about it)
- host-objects: audio-js communication including spsc (and shadow state in future)
- ts-api: how to wrap our c++ and add support for web, web audio api compatibility
- audio-recorder
- native ios- session, player, recorder, interruptions
- native android- FGS, focus(interruptions), , player, recorder
- utils
- thread safety
| - Allocate or free memory (`new`, `delete`, `malloc`, `free`, `std::vector::push_back` that grows, etc.) | ||
| - Acquire any mutex or lock (`std::mutex`, `std::lock_guard`, etc.) | ||
| - Make any blocking syscall (file I/O, socket, `sleep`, `wait`) | ||
| - Call into JavaScript — no JSI calls, no `callInvoker_->invokeSync()` |
Collaborator
Author
There was a problem hiding this comment.
not true
Contributor
There was a problem hiding this comment.
wwhat is not true here ?
Comment on lines
+199
to
+211
| ## AudioParam — Automatable Parameters | ||
|
|
||
| Every automatable property (frequency, gain, detune, Q, etc.) is an `AudioParam`. | ||
|
|
||
| ```cpp | ||
| gainParam_ = std::make_shared<AudioParam>( | ||
| defaultValue, | ||
| minValue, | ||
| maxValue, | ||
| context | ||
| ); | ||
| ``` | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
maybe let's split AudioParam from AudioNode skill
Comment on lines
+249
to
+264
| ## Cross-Thread Communication Patterns | ||
|
|
||
| ### JS → Audio (parameter/graph updates) | ||
| Use `CrossThreadEventScheduler` (lock-free SPSC queue). See `utils/CrossThreadEventScheduler.hpp`. | ||
|
|
||
| ### Audio → JS (events like `ended`, `loopEnded`, `positionChanged`) | ||
| Use `IAudioEventHandlerRegistry::invokeHandlerWithEventBody()` which internally calls `callInvoker_->invokeAsync()` — this safely schedules the JS callback on the JS thread from the audio thread. | ||
|
|
||
| ```cpp | ||
| // Audio-thread: fire 'ended' event | ||
| audioEventHandlerRegistry_->invokeHandlerWithEventBody( | ||
| AudioEvent::ENDED, {}); | ||
| ``` | ||
|
|
||
| Callback IDs are stored as `std::atomic<uint64_t>` on the node. `0` means no listener registered. | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
not sure if we want to include that part here.
Collaborator
Author
There was a problem hiding this comment.
I would split it into audio-js communication, audio-nodes, audio recorder and other audio objects(like audio param, context)
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.
Closes #
Introduced changes
Checklist