Recovered shards; any order, unique non-negative integer indexes starting from 0.
Sample rate of the PCM data, in Hz.
Ceiling on the PCM data size (shards plus gap fill), checked before anything is allocated. Defaults to the WAV format's own limit; callers handling untrusted shards pass less.
Assembles recovered recording shards into one WAV, in index order, filling every absent index with silence. Silence (rather than skipping the gap) keeps all later audio at its true time offset, so it stays aligned with transcript cues, which are offsets from the session's
RecordingStartedAt.The gap length is the median length of the present shards excluding the highest present index (that one is normally a partial window); with a single shard, that shard's length. It is rounded down to an even byte count (whole 16-bit samples), minimum 2.
The byte ceiling does not bound the index range on its own: under the default ceiling a single shard at index ~10^9 still fits, and the missing-index list grows with the highest index. Callers handling untrusted shards must cap the shard count and highest index themselves (recovery does, via MAX_RECOVERY_SEGMENTS) and pass a smaller
maxDataBytes.