Skip to content

feat: WebAssembly version of sync engine - #4

Open
KEYHAN-A wants to merge 1 commit into
mainfrom
feat/wasm-version
Open

KEYHAN-A wants to merge 1 commit into
mainfrom
feat/wasm-version

Conversation

@KEYHAN-A

Copy link
Copy Markdown
Owner

Summary

  • Add audiosync-wasm crate that compiles the FFT cross-correlation engine to WebAssembly (~330KB binary)
  • Add feature flags to audiosync-core to gate heavy dependencies (symphonia, reqwest, tokio, etc.) behind optional features, keeping the core analysis pipeline WASM-compatible
  • Add useBackend.js abstraction layer for Tauri vs WASM runtime detection
  • Add browser demo page (web/index.html) with drag-drop WAV file import and analysis UI

Technical Details

  • WASM build only includes: rustfft, regex, serde, ndarray — all platform-independent
  • sync() function (full-res export) gated behind audio-io feature since it needs filesystem access
  • Supports 16/24/32-bit WAV decoding directly in browser (no symphonia needed)
  • Audio resampled to 8kHz mono for analysis, matching desktop behavior

Test plan

  • cargo check -p audiosync-wasm passes
  • cargo check (full workspace) passes
  • cargo test -p audiosync-core — all 52 tests pass
  • WASM binary builds via wasm-pack build --target web
  • Manual: open web/index.html in browser, drop WAV files, run analysis

🤖 Generated with Claude Code

Add audiosync-wasm crate that compiles the FFT cross-correlation
engine to WebAssembly for browser-based audio synchronization.

Key changes:
- Add feature flags to audiosync-core gating heavy deps (symphonia,
  reqwest, tokio, etc.) behind optional features
- WASM build only includes core deps: rustfft, regex, serde, ndarray
- Built WASM binary is ~330KB (optimized with wasm-opt)
- Includes web demo page with drag-drop file import
- Add useBackend.js abstraction layer for Tauri vs WASM runtime

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant