Interface TranscribeDetailedResult<TokenTimestamp>

Represents a detailed result of transcription.

interface TranscribeDetailedResult<TokenTimestamp> {
    confidence: number;
    from: number;
    lang: string;
    text: string;
    to: number;
    tokens: {
        from: TokenTimestamp extends true
            ? number
            : undefined;
        id: number;
        p: number;
        text: string;
        to: TokenTimestamp extends true
            ? number
            : undefined;
    }[];
}

Type Parameters

  • TokenTimestamp extends boolean

Hierarchy (view full)

Properties

confidence: number

The confidence level of the transcription, calculated by the average probability of the tokens.

from: number
lang: string

The detected spoken language.

text: string
to: number
tokens: {
    from: TokenTimestamp extends true
        ? number
        : undefined;
    id: number;
    p: number;
    text: string;
    to: TokenTimestamp extends true
        ? number
        : undefined;
}[]

The tokens generated during the transcription process.

Type declaration

  • from: TokenTimestamp extends true
        ? number
        : undefined

    The start timestamp of the token, in milliseconds. Only available when token_timestamps of TranscribeParams is true.

  • id: number

    The ID of the token.

  • p: number

    The probability of the token.

  • text: string

    The text of the token, for CJK languages, due to the BPE encoding, the token text may not be readable.

  • to: TokenTimestamp extends true
        ? number
        : undefined

    The end timestamp of the token, in milliseconds. Only available when token_timestamps of TranscribeParams is true.