Skip to content

[Latent Audit] P2 · Medium · Architecture documentation says playback starts on the first chunk #81

Description

@latent-variable

Severity: Medium · stale_docs · confidence high
Location: docs/ARCHITECTURE.md:51

Impact: The documented latency and playback behavior are wrong: the player intentionally waits for a prebuffer cushion before starting.

Evidence: The document says the player begins playback on the first chunk. AudioPlayer.swift sets primeFrames to 8400 frames, approximately 0.35 seconds, at lines 31-33; feed() calls player.play() only after scheduledFrames reaches that threshold at lines 183-189. AppState passes a 0.35-second cushion at AppState.swift:571-572. The document was last changed on 2026-08-30, according to git history.

Recommendation: Rewrite the sentence to state that audio is scheduled as chunks arrive and playback begins after the configured prebuffer cushion, or immediately on flush for shorter streams.

Cross-validated by: codex — docs/ARCHITECTURE.md says “playback begins on the first chunk,” but AudioPlayer.start() sets a 0.35-second cushion and feed() calls player.play() only once scheduledFrames reaches primeFrames; flush() starts earlier only when the stream ends.

Filed automatically by latent-git-agents (auditor, agent: codex). Dedupe token: latent-audit-fp-b620786a0e70ac61

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Scheduled, not urgentcleanupRemovable code: dead paths, unused deps, tests that cannot fail

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions