audio-classification · 734K causal Conv1D + 2-layer GRU · 40 ms streaming · WASM fp32 · 3.87 MB · BSD-2-Clause

Pipecat Backchannel Detector: Streaming Turn-Taking & Barge-In Classifier

While a voice agent is speaking, pipecat-ai/backchannel-detector (3.87 MB fp32 ONNX, BSD-2-Clause) streams 40 ms audio chunks directly on CPU WASM to distinguish a brief Backchannel (continuer / assessment — keep talking) from a Floor Barge-In (negative / floor_take — stop the agent) or Silence / Pause (non_speech) before a transcript even arrives.

At a glance

Pipecat Backchannel Detector model specifications and browser runtime contract
Hugging Face model pipecat-ai/backchannel-detector (revision 4896f477 · 734K params · causal 80-mel + dilated Conv1D encoder [1, 2, 4, 8], d_model: 128 → 2-layer GRU hidden: 192 + 8-dim bot_state)
Task & runtime audio-classification · onnxruntime-web via isolated onnxruntime-web@1.21.0 worker · CPU wasm
Browser artifact & dtype backchannel-fp32.onnx (fp32 · 3.87 MB = 3,869,783 B · catalogue 3.9 MB) · License: BSD-2-Clause (bsd-2-clause)
Streaming I/O contract Inputs: chunk [1, 640] (40 ms @ 16 kHz mono), bot_state [1, 2, 8], + 7 causal state caches · Outputs per 20 ms frame: intent [1, 2, 5] softmax (continuer, assessment, negative, floor_take, non_speech), auxiliary vad [1, 2], and 8-bin vap [1, 2, 8]
Web APIs WebAssembly, Module Web Workers, Cache Storage, Web Audio / OfflineAudioContext, MediaRecorder (optional mic), Canvas 2D — all Baseline widely available

Why backchannel-fp32.onnx (3.87 MB) instead of backchannel-int8.onnx (2.33 MB): The Hub repo's INT8 graph emits a ConvInteger(10) node (/Conv_quant) that onnxruntime-web@1.21.0 WASM EP does not implement. The full fp32 artifact is only 3.87 MB, initializes in milliseconds, and streams 40 ms chunks at ~80× real time on CPU WASM with zero quantization drift.

Honest model scope (from HF model card): Trained on English full-duplex human conversations (Open Yap 1K + otoSpeech-full-duplex-280h). Decision grouping follows the model card directly: p(backchannel) = continuer + assessment and p(floor) = negative + floor_take.

1 · Live Streaming Turn-Taking Classifier

Reuses ledgered repository fixtures only (zero duplicate binary audio committed): LibriSpeech test-clean 61-70968-0000 (Paul-Gabriel Wiener, CC BY 4.0 · credits) and JFK inaugural address (20 Jan 1961, public domain, via models/whisper-speech-to-text/jfk.wav), plus deterministic in-memory JS PCM probes, local file drop/upload, and optional user-initiated mic recording.

Initialise Pipecat Backchannel Detector (3.87 MB fp32 WASM) above to run local 40 ms turn-taking classification.

Loading sample…

Turn-taking verdict

Awaiting inference

Initialise the model to classify Backchannel vs Floor Barge-In vs Silence/Pause.

Active window peaks

p(Backchannel) – · p(Floor) – · VAD –

Events detected: –

Window-level 20 ms probability timeline

p(Floor Barge-In) = negative + floor_take p(Backchannel) = continuer + assessment Auxiliary VAD Decision threshold

5-Class Streaming Intent Distribution

Run classification above to inspect all 5 intent heads.

Verdict–
Peak p(Backchannel)–
Peak p(Floor)–
Trigger latency–
Compute · Chunks–
NaN audit–

2 · See inside: 5-class temporal strip, raw head logits & VAP projection

Every 40 ms chunk (640 samples) advances seven causal cache tensors (audio_cache, stem_cache, four dilated conv blocks, and a 2-layer 192-unit gru_state) to emit two 20 ms frames across three heads: 5-way intent softmax, auxiliary user vad, and 8-bin Voice Activity Projection (vap) forecasting user vs. bot speech up to 2.0 s ahead.

5-head temporal activation strip

Raw head probabilities & log-odds logits (0 NaN check)

Per-class peak probabilities and derived log-odds logits
Intent head Turn group Peak prob Peak log-odds (logit) Active-mean log-odds
Run inference above to inspect raw head probabilities and log-odds logits.

Raw tensor audit: awaiting live ONNX run…

Auxiliary VAP future activity projection (0–2.0 s lookahead)

Why Pipecat Backchannel Detector matters

Naive voice-agent barge-in cuts off the assistant the moment VAD hears any sound — even a polite "mm-hmm" or "right" meant to keep the bot talking. Waiting for a full ASR transcript adds 400–800 ms of awkward collision. Running a 3.87 MB causal GRU directly in the browser classifies conversational intent in ~0.5 ms per 40 ms frame with zero server round-trip.

3 · Use-case ladder

4 · How the streaming ONNX API works

import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.wasm.min.mjs";

const session = await ort.InferenceSession.create(modelBytes, {
  executionProviders: ["wasm"],
});

// Feed 40 ms (640 samples @ 16 kHz) + [1, 2, 8] bot_state + 7 causal state tensors
const out = await session.run({ chunk, bot_state, ...states });
// out.intent [1, 2, 5] => [continuer, assessment, negative, floor_take, non_speech]
// p(backchannel) = continuer + assessment;  p(floor) = negative + floor_take
Show the code · worker.js — analyzeStream() (40 ms streaming loop + 7 causal states + NaN audit)
Show the code · bc-core.mjs — buildBotStateTensorData() ([1, 2, 8] bot_state framing)
Show the code · bc-core.mjs — classifyTurnFrames() (3-way Backchannel / Floor Barge-In / Silence policy)

References