feat: add VFS audio resource loading and upgrade to Elementary v4#14
Merged
feat: add VFS audio resource loading and upgrade to Elementary v4#14
Conversation
a9e5b1a to
8c31b64
Compare
There was a problem hiding this comment.
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
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>
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.
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 })