Skip to content

feat: audio latency#1129

Open
closetcaiman wants to merge 31 commits into
mainfrom
feat/audio-latency
Open

feat: audio latency#1129
closetcaiman wants to merge 31 commits into
mainfrom
feat/audio-latency

Conversation

@closetcaiman

@closetcaiman closetcaiman commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1104

⚠️ Breaking changes ⚠️

  • N/A

Introduced changes

Important

Identified race condition between oboe background thread (invoking onErrorAfterClose()) and any other thread that accesses mStream_ -> serialized it via locks (recursive_mutex exactly for clearer locking flow)
Audio Thread running onAudioReady does not require locks and thus stays consistent with no-locking policy

  • aligned AudioContext interface with spec by adding baseLatency and outputLatency
  • added inputLatency to AudioRecorder (React Native extension, not in spec)
  • all values are sourced from native APIs - AVAudioSession (iOS) and Oboe (Android)
    • platform differences in reported values are expected
  • updated docs for AudioContext and AudioRecorder with native source details

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added/Conducted relevant tests
  • Performed self-review of the code
  • Updated Web Audio API coverage
  • Added support for web
  • Updated old arch android spec file

@closetcaiman closetcaiman requested a review from mdydek June 29, 2026 13:33
@closetcaiman closetcaiman added the feature New feature label Jul 9, 2026
Comment thread packages/audiodocs/docs/inputs/audio-recorder.mdx Outdated
Comment thread packages/react-native-audio-api/common/cpp/audioapi/core/BaseAudioContext.h Outdated
Comment thread packages/react-native-audio-api/src/core/AudioRecorder.ts
Comment thread packages/audiodocs/docs/inputs/audio-recorder.mdx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose AudioContext.baseLatency / outputLatency (Web Audio spec) for latency compensation

3 participants