Function readTranscript

  • Reads a transcript file's text, or its bytes, in the format given. Bytes are read as UTF-16 when they open with its byte order mark, in either byte order, and as UTF-8 otherwise. A byte order mark is dropped and CRLF line ends are read as line feeds. A file with no turn reads as none; a length bound is the caller's.

    Parameters

    • input: string | Uint8Array<ArrayBufferLike>

      The file's text, or its bytes.

    • format: "srt" | "vtt" | "otter" | "fireflies" | "lines"

      Its format; a Word file is read from its bytes by readWordTranscript.

    Returns ReadTranscript

    Throws

    TranscriptReadError for a WebVTT text whose first line is not WEBVTT, a Fireflies text that is not JSON, and the format docx.