forked from abh1nash/ace-daw
-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Audio output latency is not measured or compensated. This causes:
- Recording offset: Recorded audio is misaligned with the grid by the output latency amount
- Visual desync: Playhead position doesn't account for audio pipeline delay
- Live monitoring: Input monitoring has uncompensated round-trip latency
Without latency calibration, recording is unreliable and users cannot trust timing.
Proposed Solution
- Auto-detect: Read
AudioContext.baseLatency+AudioContext.outputLatencyon context creation - Display: Show detected latency in Settings panel (in ms and samples)
- Manual override: Allow users to enter custom latency value (for external audio interfaces)
- Compensation: Offset recorded audio by the calibrated latency amount
- Visual compensation: Adjust playhead rendering to account for output latency
Technical Notes
- Reference: TASK_QUEUE.md Sprint 2 backlog item
- Key files:
src/engine/AudioEngine.ts,src/components/dialogs/SettingsDialog.tsx baseLatencysupported in Chrome/Firefox/Safari;outputLatencyChrome-only- For unsupported browsers, fall back to manual entry with sensible default (10ms)
Acceptance Criteria
- Settings panel shows detected audio latency
- Users can manually override latency value
- Recorded audio clips are offset-corrected by latency amount
- Latency value persists across sessions
- Fallback for browsers without
outputLatencyAPI - Unit test for latency compensation calculation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request