Type Alias ChannelAttributionParams

ChannelAttributionParams: {
    createVad?: ((channelName: string) => VadDetector);
    dominanceRatio?: number;
    flushIntervalMs?: number;
    resolutionWindowWords?: number;
    resolveUnknownChannelsMethod?: "none" | "window" | "speaker-history";
    speakerHistoryDominanceRatio?: number;
    speakerHistoryMinRmsEvidence?: number;
    timelineWindowMs?: number;
}

Per-channel attribution tuning for dual-channel mode. All fields optional; ignored when StreamingTranscriberParams.channels is not set.

Type declaration

  • OptionalcreateVad?: ((channelName: string) => VadDetector)

    Factory for the per-channel VAD detector. Called once per declared channel at transcriber construction time. The channel name is passed so factories that wrap higher-level VAD libraries (which manage their own audio source) can map each VadDetector instance to its corresponding channel.

  • OptionaldominanceRatio?: number

    Energy ratio above which a channel is declared dominant for a word. Default 4.

  • OptionalflushIntervalMs?: number

    Mix flush interval in ms — how often per-channel buffers are summed and sent. Default 50.

  • OptionalresolutionWindowWords?: number

    Half-window (in words) on each side of an "unknown" word for the "window" method. Default 2 — so the full window is up to 5 words (2 before + the unknown + 2 after).

  • OptionalresolveUnknownChannelsMethod?: "none" | "window" | "speaker-history"

    Strategy used to fill words whose per-word VAD attribution resolved to "unknown". Confident per-word VAD decisions ("mic" / "system") are never modified by any strategy.

    • "window" (default): look at the dominant non-"unknown" channel among ±resolutionWindowWords neighboring words in the same turn. Ignores speaker_label, so it works even when AAI re-uses a label for two physically distinct voices.
    • "speaker-history": accumulate per-speaker_label per-channel active VAD energy across the session, then fill "unknown" words with the speaker's dominant channel when it clears speakerHistoryMinRmsEvidence and beats runner-up by speakerHistoryDominanceRatio. Robust for stable speaker labels but does nothing when a speaker has split evidence.
    • "none": disable resolution; "unknown" words remain "unknown" in the output.
  • OptionalspeakerHistoryDominanceRatio?: number

    For the "speaker-history" method, the top channel's evidence must exceed the runner-up's by at least this factor for the speaker to be considered pinned to that channel. Default 3.

  • OptionalspeakerHistoryMinRmsEvidence?: number

    Minimum cumulative active-RMS evidence (sum across all the speaker's frames to date) before a speaker can be resolved via the "speaker-history" method. Default 0.5 — roughly a few seconds of sustained speech.

  • OptionaltimelineWindowMs?: number

    Rolling VAD timeline window in ms. Default 30_000.