Fork of Brotherta/wam-studio. See the upstream README for the full project description, citation, and Docker instructions.
This fork replaces WAM Studio's built-in threshold-based latency calibration
tool with <latency-test>
(@adasp/latency-test), which measures round-trip audio latency using an MLS
signal and cross-correlation.
It also fixes a formula bug in the original calibration: the old implementation
subtracted outputLatency from the measured round-trip, leaving a residual
offset in recorded tracks. This fork uses the full round-trip value directly,
which is what SampleRegionRecorder needs to align a recording correctly.
The fork is a research deliverable of the Hi-Audio project and serves as a working showcase for a proposed upstream PR to Brotherta/wam-studio.
| File | Change |
|---|---|
public/src/Controllers/LatencyController.ts |
Rewritten — uses <latency-test> instead of the original threshold-based AudioWorklet peak-detector |
public/src/Audio/LatencyProcessor.js |
Deleted — replaced by the component |
public/package.json |
Added @adasp/latency-test@1.2.1 |
Key behaviour changes:
- 3-run MLS/cross-correlation measurement instead of single-shot threshold detection
- Reliability gate: prior calibration left untouched if any run is unreliable or the user stops early
- Race-safe: stale-element guards prevent a rejected async operation from clobbering a newer calibration run
- Uses the main
AudioContext(not a fresh one) — same output sink, sample rate, andoutputLatencyas the recording pipeline
cd public
npm install
cp /dev/null .env # empty .env is fine — defaults apply
npm start # → http://localhost:5002Requires a microphone and headphones. The backend bank/plugin server is not needed for the latency calibration demo. One failed login fetch at startup is expected and harmless.
This app uses SharedArrayBuffer, which requires cross-origin isolation.
The server must respond with:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
The webpack dev server (npm start) sets these automatically. For production,
the netlify.toml in this repo configures them for Netlify deployments, or run
node server.js (which sets them via Express).
You can verify cross-origin isolation is active in the browser console:
crossOriginIsolated // must be truehttps://charming-paletas-c95a3f.netlify.app
- Implementation notes and findings:
demos/wam-studio/NOTES.mdin idsinge/latency-test-examples <latency-test>component source and API docs: idsinge/latency-test
This fork builds on WAM Studio by Michel Buffa and Antoine Vidal-Mazuy (Université Côte d'Azur / Inria). Please cite the upstream work if you use this:
@inproceedings{buffa2023wam,
title={WAM-studio, a Digital Audio Workstation (DAW) for the Web},
author={Buffa, Michel and Vidal-Mazuy, Antoine},
booktitle={Companion Proceedings of the ACM Web Conference 2023},
pages={543--548},
year={2023}
}
This fork is part of Hybrid and Interpretable Deep Neural Audio Machines (Hi-Audio), funded by the European Research Council (ERC) under Horizon Europe (grant agreement No. 101052978).