-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add VFS audio resource loading and upgrade to Elementary v4 #14
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
Conversation
a9e5b1a to
8c31b64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Virtual File System (VFS) audio resource loading capabilities and upgrades Elementary Audio to v4, enabling dynamic loading and playback of audio samples.
Changes:
- Added
loadAudioResource/unloadAudioResourceAPIs with miniaudio-based cross-platform audio decoding - Upgraded Elementary submodule and
@elemaudio/coredependency from v2 to v4.0.3 - Updated NativeRenderer constructor to match Elementary v4's sendMessage-only API
Reviewed changes
Copilot reviewed 19 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.tsx | Exported new VFS APIs and updated NativeRenderer for Elementary v4 |
| src/NativeElementary.ts | Added TurboModule interface methods for audio resource management |
| package.json | Updated @elemaudio/core to v4.0.3 |
| ios/Elementary.mm | Implemented audio resource loading/unloading with AudioBufferResource |
| ios/Elementary.h | Added loadedResources property for tracking loaded audio |
| ios/AudioResourceLoader.mm | iOS implementation of audio file decoding using miniaudio |
| cpp/AudioResourceLoader.h | Cross-platform audio loader header with metadata structures |
| cpp/AudioResourceLoader.cpp | C++ implementation of audio decoding and deinterleaving |
| cpp/audioengine.h | Added VFS method declarations and resource tracking |
| cpp/audioengine.cpp | Implemented audio resource management in AudioEngine |
| android/src/main/java/com/elementary/ElementaryModule.kt | Android native module implementation of VFS APIs |
| android/cpp-adapter.cpp | JNI bridge for audio resource operations |
| example/App.tsx | Comprehensive demo app showcasing sample loading and playback |
| AGENTS.md | Documentation for AI coding assistants |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8c31b64 to
af387e2
Compare
- Add loadAudioResource/unloadAudioResource APIs for loading audio files - Upgrade Elementary submodule from v3 to v4.0.3 - Update to Elementary v4 runtime API (addSharedResource, AudioBufferResource) - Update NativeRenderer for Elementary v4 (sendMessage only constructor) - Add miniaudio-based AudioResourceLoader for cross-platform audio decoding - Fix audio buffer zeroing to prevent garbage noise - Add example app with drum samples demonstrating VFS usage - Bundle samples folder into iOS app resources - Use react-native-fs for platform-specific file access Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1364ae5 to
b390e3d
Compare
tamlyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! 🙌
Remove unnecessary getSampleRate() call since Elementary v4 no longer requires sample rate in the constructor. The hook now synchronously returns the renderer instance. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
loadAudioResource/unloadAudioResourceAPIs for loading audio files into the Virtual File System@elemaudio/coreto v4.0.3AudioBufferResourcefor proper multi-channel sample supportCloses #10
Test plan
loadAudioResource()el.sample({ path: key })