Skip to main content

Chunked Upload Flow

This document describes the sequence of operations when a user uploads audio in chunks to a session.

Data Model

  • Sessions: 1 per upload session
  • Audio Chunks: N per session (individual uploaded chunks)
  • Audios: 1 per session (final stitched audio file)
  • Transcriptions: N+1 per session
    • N transcriptions for individual chunks (audio_chunk_id set, audio_id NULL)
    • 1 final transcription for stitched audio (audio_id set, audio_chunk_id NULL)
  • Summarisations: 1 per session (generated from the final transcription)

Key Points

  1. Live Feedback: Each chunk is transcribed immediately for real-time feedback
  2. Final Quality: The stitched audio is transcribed separately for the highest quality result
  3. Summarisation: Only the final transcription is used for summarisation
  4. Data Integrity: Foreign key constraints ensure proper relationships between entities
  5. Gaps: A missing sequence number holds the final stitch; the track stays finalising until the chunk arrives or the stale-track sweeper stitches after 120 s
  6. WebM header: Browser chunks after the first carry only the WebM header bytes of chunk 1, not its audio, so each chunk decodes alone without repeating the first second
  7. Paused tracks: Count as abandoned only after phone_capture.idle_close_minutes (default 60), not the 120 s heartbeat window