feature: OpusFormatDecoder — Ogg-page-aligned segmenting, sidecar parser, accurate index-based seek (Phase 18.4)

This commit is contained in:
daniel-c-harvey
2026-06-23 08:34:39 -04:00
parent e807ddb91b
commit 261289c1b8
8 changed files with 723 additions and 5 deletions
@@ -1,3 +1,5 @@
import { OpusSeekData } from './OpusSidecar.js';
/**
* FormatInfo: parsed header data needed to stream and seek an audio file.
* Populated by IFormatDecoder.tryParseHeader; used by StreamDecoder throughout playback.
@@ -36,8 +38,10 @@ export interface FormatInfo {
* MP3 VBR: Xing/VBRI TOC (100-entry Uint8Array, values are file-percentage * 255).
* FLAC: SeekTable (array of {sampleNumber: number, streamOffset: number} — stream_offset
* is bytes from the start of audio frames, i.e. after all metadata blocks).
* Opus: OpusSeekData — the precomputed granule->byte index + OpusHead/OpusTags setup bytes,
* parsed from the sidecar artifact (NOT byteRate math; see OpusFormatDecoder).
*/
seekData?: Mp3VbrSeekData | FlacSeekData | null;
seekData?: Mp3VbrSeekData | FlacSeekData | OpusSeekData | null;
}
export interface Mp3VbrSeekData {