VideoUltra API
    Preparing search index...

    Interface CaptionsEndpointOptions

    interface CaptionsEndpointOptions {
        detector?: SpeechDetectorOptions;
        endpoint: string;
        fetch?: {
            (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
            (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        languages?: readonly string[];
        parallel?: number;
        retryWait?: number;
        speed?: number;
        voice?:
            | "detector"
            | "loudness"
            | (
                (
                    sound: Float32Array,
                ) => Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>
            );
    }
    Index

    Where the speech detector's model and runtime come from (see createSpeechDetector).

    endpoint: string

    Your captions endpoint — your own server, which calls whichever speech service you use and keeps its key (see CaptionsEndpointReply for what it receives and answers).

    fetch?: {
        (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
        (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
    }

    For tests / custom transports. Default: the global fetch.

    Type Declaration

      • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
      • Parameters

        • input: RequestInfo | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
      • Parameters

        • input: RequestInfo | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Extra request headers (e.g. your app's session token).

    languages?: readonly string[]

    Languages your service hears (ISO 639-1), plus 'auto' if it can detect the language; the Captions panel offers exactly these. Default: the panel's own list and Detect.

    parallel?: number

    Pieces sent at once on long videos (one while the service is busy). Default 3.

    retryWait?: number

    First wait before trying a busy service again (ms), doubling each time, four tries more; a Retry-After header from your endpoint wins. Default 3000.

    speed?: number

    Roughly how many seconds of speech it captions per second, for "about N min". Default 8.

    voice?:
        | "detector"
        | "loudness"
        | (
            (
                sound: Float32Array,
            ) => Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>
        )

    How to find where people speak in a piece. 'detector' (default where workers run): a small speech detector on the device (createSpeechDetector) — tells speech from music and noise; 'loudness': by loudness only (no download); or your own (one byte per 20 ms, 1 = speech).