/docs · VoiceLab · Practical
Let your Pipecat agent know when the call broke up
A pass-through processor for Pipecat that measures the caller and the bot while they talk: dropouts, clipping, level drops, dead air and hum. Turn an event into a note in the LLM context, so the bot asks the caller to repeat instead of answering half a sentence. The audio stays on your machine.
Updated Nov 3, 2026
When a packet is lost on a call, the caller’s sentence arrives with a hole in it. A person on the other end notices and says “sorry, you broke up”. A voice agent usually does not: the speech-to-text returns what it got, the LLM answers it, and the caller hears a confident reply to something they did not quite say.
The bot can only ask again if something tells it the audio broke. audiolabtools-pipecat is that something for a Pipecat pipeline. It watches the caller and the bot while they talk and calls you back with an event when the audio has a gap, clipping, a level drop, dead air or hum. You decide what the bot does with it.
The events are measurements of the signal, not the guess of a model. A dropout is a run of samples that are exactly zero for 20 ms or more, the hole a lost packet leaves. Clipping is samples stuck at full scale. That is why an event comes with numbers you can check, and also why it has limits, listed below.
What you need
- A Pipecat pipeline (checked with Pipecat 1.14.0 and 1.15.0 on Python 3.13).
- Node.js 22 or newer on the same machine. The measuring runs in a small local process,
audiolab-livefrom npm. - No key and no account. The audio goes over a pipe to that local process and is thrown away there; only the events come back. Nothing is sent to AudioLab.
pip install audiolabtools-pipecat
npx -y @audiolabtools/live@0.2 --demo # optional: see a first event in a few seconds
1. Put the monitor in the pipeline
AudioLabMonitor is a pass-through processor: every frame goes on unchanged, and the raw audio is copied to the monitor. Put one after the input to watch the caller, and one before the output to watch what the bot is about to say:
from audiolab_pipecat import AudioLabMonitor
async def on_event(ev):
print(ev["stream_id"], ev["type"], ev["update"], ev["reason"])
pipeline = Pipeline([
transport.input(),
AudioLabMonitor(on_event, watch=("user",)), # the caller, as it arrives
stt, user_aggregator, llm, tts,
AudioLabMonitor(on_event, watch=("bot",)), # what the bot is about to say
transport.output(),
assistant_aggregator,
])
Each event is sent twice: once when the monitor raises it ("update": "raised") and once when it ends ("closed", with duration_s). The streams are named call-user and call-bot. Change the prefix with stream_prefix=, and use a code, never a name or a phone number.
2. Let the bot act on it
If on_event returns a Pipecat frame, the monitor pushes it downstream. Because the caller’s monitor sits before the user aggregator, an LLMMessagesAppendFrame lands in the LLM context:
from pipecat.frames.frames import LLMMessagesAppendFrame
def on_event(ev):
if ev["type"] == "dropout" and ev["update"] == "closed" and not ev["evidence"].get("endOfStream"):
note = (f"The caller's audio was cut for {ev['duration_s']:.1f} s just now, so part of what they said may be missing. "
"If their last words look incomplete, ask them to repeat that part.")
return LLMMessagesAppendFrame([{"role": "system", "content": note}], run_llm=False)
run_llm=False adds the note without making the bot speak. The LLM reads it with the caller’s next turn, together with the transcript that has the hole in it. The same pattern works for other events:
| Event | What the bot could say |
|---|---|
dropout |
“Sorry, you broke up for a moment. Could you say that last part again?” |
level_drop |
“You’re getting quieter, could you come a bit closer to the phone?” |
dead_air |
“Are you still there?” |
Keep the wording in the note, not in code: the LLM knows the conversation and can decide whether the missing part mattered.
3. Know where you measure
The two monitors do not see the same thing. Where you can, measure on the bot side, before the codec. That is where study Live test4 met its criteria, with faults planted on purpose: in this pipeline and on a LiveKit track before Opus. After Opus most planted gaps were missed, and after 8 kHz telephone audio (mu-law) the clipping rule missed its criteria.
- The bot side sees the PCM before the transport encodes it. Gaps and clipping there are seen exactly: in our pipeline test, the planted gap and the planted clipping were found and a clean control raised neither.
- The caller side sees the audio after the transport has decoded it. A gap that arrives as exact zeros is seen, but after Opus a gap often no longer arrives that way: in a first LiveKit trial 26 of 30 gaps were found, and in study Live test4 most planted gaps were missed. Clipping is not seen: Opus rounds off the flat tops, and in that first trial it was found 0 of 30 times. A
humevent can come from the codec rather than the line, so do not act onhumfrom the caller side. - A platform that skips frames instead of sending zeros leaves no gap in the audio, so no
dropout. - When the call ends in silence, the last dropout is closed with
evidence.endOfStream: true. Ignore those, as the example does.
What it does not do
It does not hear a TV in the background or a second voice on the line. Telling one voice from another takes a model, and this monitor only measures the signal. It also does not judge the call: every detector has the status “signals”, which means none is validated on live calls yet. Treat an event as a reason for the bot to check, not as a diagnosis.
For a full analysis of a recording after the call (loudness, signal-to-noise, bandwidth, where the audio has been, and the other lenses on /lenses), send it to the AudioLab API or MCP server. That route does upload the audio; see /privacy. For gaps in recordings you already have, see Find lost packets in a recording.
To see what this monitor would have raised on a recording, add "liveEvents": true to a request to analyze/profile, or liveEvents: true to the MCP tool analyze_profile. The same monitor reads the file as a stream, 20 ms at a time, and returns every event with its time, its reason and its numbers, all with the status “signals”. A gap or clipping event also names the field of the file analysis that measures the same fault with a rule of its own (chain.dropoutCount or signal.clipping), with its status and why the two can differ.
Beta
This is a first version. It was tested in a real Pipecat PipelineTask fed from WAV files, and the note from step 2 was checked in a real LLMContext. It has not yet run in a live call over a real transport.
Next in VoiceLab docs
What envelope decay after speech actually measures →
We built a cheap reverb proxy from the decay after each phrase, then tested it against 24 measured rooms. It does not measure reverb. Here are the numbers and what we changed.
More in VoiceLab docs
- Intro
Voice AI: ten questions, answered
What AudioLab measures for a voice agent, what it does not, where your audio goes, how a verdict is made and who sets the limits, how to compare versions and automate the checks, and what is free.
- Intro
Why filler density matters more than filler count
Counting "ums" is the wrong measurement. Density tells you whether they are a problem.
- Practical
A pragmatic loudness target for podcasts
The right loudness target for spoken-word podcasts is not the same as music. Here are the numbers and why.
- Practical
Read the audio before you transcribe
One call before the model: what the scene fields tell you about a file, and what they do not, with the numbers from our own transcription test.
- Practical
Test a noise filter before speech-to-text
Does noise suppression help your transcripts or hurt them? An A/B on your own calls in five steps: free filters (RNNoise, DeepFilterNet, ffmpeg), what the filter did to the audio, and the word error rate of your own STT.
- Practical
Measure how long a room rings with one clap
The room profile reads the reverberation time per octave band from one clap, a balloon pop, an impulse response or a sweep. How to record it, how to read the answer, and how far the numbers are tested.
- Practical
Pitch and voice quality: what the profile gives and what it holds back
The pitch profile reads where a voice sits, how much it moves, how voiced the recording is and how clean the voice is. The test numbers, the limits, and why jitter and shimmer are not offered yet.
- Practical
Find lost packets in a recording
The chain profile counts the gaps of digital silence that a lost packet leaves in the middle of speech. How it decides, the test numbers, what it cannot see, and the echo and slapback measure.