transcript_types.ts

view source

Declarations
#

5 declarations

is_plain_file_name
#

transcript_types.ts view source

(name: string): boolean import {is_plain_file_name} from '@fuzdev/zzz/transcript_types.js';

Whether name is one path component: not empty, not . or .., and with no separator in it.

name

type string

returns

boolean

Transcript
#

transcript_types.ts view source

value + type

{ [x: string]: unknown; version: number; source: { [x: string]: unknown; name: string; blake3: string; size: number; duration_ms: number; }; tool: { [x: string]: unknown; backend: string; version: string | null; model: string; model_blake3: string; params: { ...; }; }; language: string | null; segments: { ...; }[]; } import {Transcript} from '@fuzdev/zzz/transcript_types.js';

A transcript sidecar: the file a transcription writes beside its source, <source name>.<model>.transcript.json. It records what it was made from and what made it. Twin of the backend's Transcript.

Loose, because it's a file on disk: one written by a newer zzz may carry fields this one doesn't know.

version

type number

source

type { [x: string]: unknown; name: string; blake3: string; size: number; duration_ms: number; }

tool

type { [x: string]: unknown; backend: string; version: string | null; model: string; model_blake3: string; params: { [x: string]: unknown; language: string; }; }

language

type string | null

segments

type TranscriptSegment[]

[key: string]

type unknown

TRANSCRIPT_SIDECAR_SUFFIX
#

transcript_types.ts view source

".transcript.json" import {TRANSCRIPT_SIDECAR_SUFFIX} from '@fuzdev/zzz/transcript_types.js';

What every transcript sidecar's name ends with.

TranscriptSegment
#

transcript_types.ts view source

value + type

{ start_ms: number | null; end_ms: number | null; text: string; words?: { start_ms: number; end_ms: number; text: string; p: number; }[] | undefined; } import {TranscriptSegment} from '@fuzdev/zzz/transcript_types.js';

A stretch of speech. The times are null from a recognizer that doesn't time its text — then the segment can't be sought to.

start_ms

type number | null

end_ms

type number | null

text

type string

words?

type TranscriptWord[]

TranscriptWord
#

transcript_types.ts view source

value + type

{ start_ms: number; end_ms: number; text: string; p: number; } import {TranscriptWord} from '@fuzdev/zzz/transcript_types.js';

One word of a transcript segment, with the recognizer's confidence in it.

start_ms

type number

end_ms

type number

text

type string

p

0 to 1.

type number

Imported by
#