Total duration in seconds (max segment endTime).
Full mixed/concatenated conversation audio as WAV bytes.
Save the full conversation to a file.
Format is inferred from the path suffix or overridden by format.
.wav is written natively; non-WAV formats transcode via the bundled
ffmpeg subprocess (see resolveFfmpegPath).
path is resolved before writing; format is validated against an
allowlist so callers can't pass arbitrary ffmpeg muxer names.
Optionalformat: stringWrite each segment as its own WAV file plus the full mixed conversation, optionally with a JSON manifest pairing files to transcripts/timestamps.
Layout:
<dir>/
segments/
00-user-0000ms.wav
01-agent-0312ms.wav
...
full.wav
manifest.json # iff manifest=true
Segment file names: zero-padded index, role, start_time in milliseconds.
Existing files inside dir are NOT cleared — caller decides retention.
Runtime implementation of VoiceRecording. Stores PCM16 segments and lets callers serialize them as WAV / MP3 / OGG / FLAC or as a segment directory with a JSON manifest.
Construction is cheap — the executor creates an empty instance at the start of a voice scenario and appends segments + timeline events as the conversation unfolds.