Function: transcriptFormatOf()
transcriptFormatOf(
name,head):TranscriptFormat|null
Defined in: packages/agentos/src/cognition/library/transcripts/index.ts:76
The format of a transcript file, by its name's extension and its bytes, which must be the format the name
claims; null when it is none of them. A .srt holds a timing line; a .vtt opens with WEBVTT; a .json holds
Fireflies's keys; a .docx is a ZIP archive; a .txt or .md is text, otter when it is laid out as Otter's
export and lines otherwise. The bytes are read as readTranscript reads them. A PDF is no transcript,
whatever its name.
Parameters
name
string
The file's name or path.
head
The file's bytes or its text, whole where it can be: a Word file, SubRip and WebVTT are named from their first 4 KB, but Fireflies's JSON can hold its sentences, and Otter's export its second turn, past any head of the file. A head's last line with no line feed after it may stop short, so it is read as words, never as a header.
string | Uint8Array
Returns
TranscriptFormat | null