📍 Join the 1st DeepEval meetup in SF, this Friday 5pm PT. RSVP on Luma →
💥 Introducing JevEval: Jev-as-a-Judge for LLM evaluation. Read the post →
Voice AgentsAudio Defects

Held Tone

Beta
Multi-turn
Referenceless
Chatbot
Voice

The held tone metric checks whether your voice agent's audio contains a stuck tone or drone, such as a steady beep or a sound frozen on one pitch. It returns the share of agent replies with no held tone, between 0 and 1.

0.0s / 4.7s

Required Arguments

To use the HeldToneMetric, you'll have to provide a ConversationalTestCase with audio on the agent's turns, or on the test case as a stereo recording of the whole call*.

With per-turn audio, an Audio.start_time on each clip is optional, and only used to place events on the call's clock.

* Full call audio has to be stereo, with the caller and agent on separate channels, and is only used when no turn has audio. Each agent reply is then heard on the agent's channel, from its first sound until the caller speaks.

Usage

The HeldToneMetric() can be used for end-to-end evaluation of voice calls, such as ones produced by the ConversationSimulator in voice mode:

from deepeval import evaluate
from deepeval.dataset import ConversationalGolden
from deepeval.metrics import HeldToneMetric
from deepeval.simulator import ConversationSimulator
from deepeval.voice import ElevenLabsConnector, VoiceConfig


golden = ConversationalGolden(
    scenario="The user asks the agent to look up an order by its number.",
    expected_outcome="The agent reads back the order status.",
)

simulator = ConversationSimulator(
    voice_config=VoiceConfig(
        connector=ElevenLabsConnector(agent_id="your-agent-id"),
    )
)
test_cases = simulator.simulate([golden])

metric = HeldToneMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])

The HeldToneMetric has no optional parameters of its own. It takes only the common voice metric parameters.

As a standalone

You can also run the HeldToneMetric on a single test case as a standalone, one-off execution:

metric.measure(test_cases[0])

print(metric.score, metric.reason)
print(metric.score_breakdown)

See Events for what score_breakdown contains.

Events

Each held tone shows up in score_breakdown as its own event. Here is what the example call returns:

{
    "eligible_turns": 4,
    "turns_with_events": 1,
    "events": [
        {
            "type": "held_tone",
            "turn": 5,
            "role": "assistant",
            "offset_seconds": 1.48,
            "duration_seconds": 1.52,
            "start_time": 14.98,
            "mark": "range",
            "timing_source": "turn_timestamps",
            "description": "A tone was held for 1.5s",
            "position": "middle",
            "pitch_hz": 388.0,
            "periodicity": 0.993,
            "level_dbfs": -18.0,
            "jitter": 0.0,
            "glide": 0.0,
            "hold_ratio": 7.6,
            "pitch_ratio": 1.7,
        }
    ],
    "skipped": [],
}
FieldWhat it means
pitch_hzThe tone's pitch
periodicityHow regular the sound is, from 0 to 1. A pure tone is close to 1
level_dbfsHow loud the tone is
jitterHow much the pitch wobbles from one 40 ms frame to the next, as a share of the pitch
glideHow far the pitch drifts from the start of the tone to its end, as a share of the pitch
hold_ratioHow many times longer the tone is than the agent's typical held sound
pitch_ratioHow many times higher the tone is than the agent's usual pitch
positionWhether the tone is near the start, middle or end of the clip

Clips that can't be decoded are listed under skipped. Every event also has the fields all voice events share, such as mark and description.

eligible_turns is how many agent replies were counted and turns_with_events how many had a held tone. The score is the share that had none.

How Is It Calculated?

The HeldToneMetric score is calculated according to the following equation:

Held Tone=Number of Agent Replies Without a Held ToneTotal Number of Agent Replies\text{Held Tone} = \frac{\text{Number of Agent Replies Without a Held Tone}}{\text{Total Number of Agent Replies}}

Held tone criteria

A voice holding a vowel wobbles and drifts in pitch. A stuck tone doesn't.

Agentheld vowelheld tone0s2s4s6s8s

A stretch is a held tone when it holds one steady pitch:

CheckRule
LengthAt least 0.8 seconds
PitchBetween 60 and 1000 Hz
RegularPeriodicity at least 0.85
No wobbleJitter at most 0.2% of the pitch
No driftGlide at most 1% of the pitch

and it stands out from the agent's own voice in at least one way:

CheckRule
Held too longAt least 3 times the agent's typical held sound
Too highAt least 1.3 times the agent's usual pitch
Long outrightAt least 2.5 seconds

The agent's typical held sound and usual pitch come from all of its clips in the call, so a slow speaker sets their own baseline.

If there's nothing to count, the metric is skipped.

Example call

A call where the agent holds a vowel in one reply and plays a steady beep in another.

Agentturn 1turn 3turn 5turn 7clean: vowel0s5s10s15s20s
Agent turnWhat happensHeld tone?
1Normal speechNo
3A 1 s vowel whose pitch drifts downNo
5A 1.5 s beep at 388 Hz, far higher than the agent's voiceYes
7Normal speechNo
4 replies1 held tone → 3/4 = 0.75

FAQs

Will a slow or sing-song voice be flagged?
Unlikely. A tone must hold one pitch with almost no wobble or drift, and it's compared with how long and how high this agent normally holds a sound across the call.
A tone I can hear wasn't flagged. Why?
It may be too short, wobble or slide the way a voice does, or sit close to the agent's own pitch. Also check that it's inside the turn's clip: a sound the TTS plays after the last word can fall past the end of the clip.
Does this metric call an LLM or an external speech model?
No. Detection is deterministic and runs locally over the audio, so it has no model or token cost.
Does it check the caller's audio too?
No. Only the agent's replies are scored. The caller is your simulator's TTS voice or a real customer, so their audio says nothing about the agent.

On this page