Skip to content

feat: audio latency#1129

Merged
mdydek merged 38 commits into
mainfrom
feat/audio-latency
Jul 24, 2026
Merged

feat: audio latency#1129
mdydek merged 38 commits into
mainfrom
feat/audio-latency

Conversation

@closetcaiman

@closetcaiman closetcaiman commented Jun 29, 2026

Copy link
Copy Markdown
Member

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
Comment thread packages/audiodocs/docs/core/audio-context.mdx Outdated
Comment thread packages/audiodocs/docs/core/audio-context.mdx Outdated
@closetcaiman
closetcaiman requested a review from mdydek July 21, 2026 13:25
Comment thread packages/react-native-audio-api/ios/audioapi/ios/core/IOSAudioPlayer.h Outdated
@closetcaiman
closetcaiman requested a review from mdydek July 24, 2026 08:39
@mdydek
mdydek merged commit d276254 into main Jul 24, 2026
9 checks passed
@mdydek
mdydek deleted the feat/audio-latency branch July 24, 2026 13:26
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