📍 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 Level

Loudness

Beta
Multi-turn
Referenceless
Chatbot
Voice

The loudness metric checks whether your voice agent speaks too quietly or too loudly, for example so quietly that the caller has to turn the volume up. It returns the share of agent replies whose speech level falls inside an accepted range, between 0 and 1.

CallerAgent
0.0s / 8.5s

Required Arguments

To use the LoudnessMetric, 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*.

* 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 LoudnessMetric() 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 LoudnessMetric
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 = LoudnessMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])

There are TWO optional parameters specific to the LoudnessMetric, on top of the common voice metric parameters:

  • [Optional] min_dbfs: an integer for the quietest speech level a reply may have, in dBFS (decibels relative to full scale, where 0 is the loudest a digital sample can be). Must be lower than max_dbfs. Defaulted to -32.
  • [Optional] max_dbfs: an integer for the loudest speech level a reply may have, in dBFS. Must be 0 or lower. Defaulted to -10.

As a standalone

You can also run the LoudnessMetric 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 reply that was too quiet or too loud shows up in score_breakdown as one event. Here is what the example call returns:

{
    "eligible_turns": 4,
    "turns_with_events": 2,
    "events": [
        {
            "type": "too_quiet",
            "turn": 3,
            "timing_source": "turn_timestamps",
            "description": "Reply was too quiet (-36 dBFS)",
            "speech_dbfs": -35.7,
            "offset_seconds": 0.0,
            "duration_seconds": 3.0,
            "start_time": 8.5,
            "mark": "whole_reply",
        },
        {
            "type": "too_loud",
            "turn": 7,
            "timing_source": "turn_timestamps",
            "description": "Reply was too loud (-4 dBFS)",
            "speech_dbfs": -4.2,
            "offset_seconds": 0.0,
            "duration_seconds": 3.0,
            "start_time": 20.5,
            "mark": "whole_reply",
        },
    ],
    "skipped": [],
}
FieldWhat it means
typeToo quiet or too loud
speech_dbfsThe reply's speech level, in dBFS

Each event covers the whole reply, so offset_seconds is 0 and duration_seconds is the clip's length. Replies with under 1 second of speech, including silent ones, and replies 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 were out of range. The score is the share that weren't.

How Is It Calculated?

The LoudnessMetric score is calculated according to the following equation:

Loudness=Number of Agent Replies Within the Loudness RangeTotal Number of Agent Replies\text{Loudness} = \frac{\text{Number of Agent Replies Within the Loudness Range}}{\text{Total Number of Agent Replies}}

Which replies are scored

Agentturn 1turn 3turn 5reply 1no speechreply 20s2s4s6s8s10s

A reply is scored if its speech spans at least 1 second, from the first to the last 20 ms frame louder than silence (about −41 dBFS). A shorter reply, such as a lone "mm-hm", is too brief for its level to mean much. A reply with no audible sound at all is left to Silent Reply.

Loudness criteria

Agenttoo quietin rangetoo loud

Each reply is cut into 20 ms frames. Its speech level is the 90th percentile of the frames at speech volume (about −41 dBFS or louder), so pauses don't make a reply look quiet.

CheckRule
Too quietSpeech level below min_dbfs (−32 dBFS)
Too loudSpeech level above max_dbfs (−10 dBFS)

If no reply has at least 1 second of decodable speech, the metric is skipped.

Example call

A call where one agent reply is far too quiet and one is far too loud.

Agentturn 1turn 3turn 5turn 70s5s10s15s20s
Agent turnSpeech levelOut of range?
1−19.2 dBFSNo
3−35.7 dBFSYes (too quiet)
5−19.2 dBFSNo
7−4.2 dBFSYes (too loud)
4 replies2 out of range → 2/4 = 0.5

FAQs

How is this different from Speech Intelligibility?
SpeechIntelligibilityMetric runs this metric together with background noise, clipping and dropouts, and scores the share of replies none of them flagged. This metric reports loudness alone, including whether the speech was too quiet or too loud.
Does a loud, distorted reply count here and in Audio Clipping?
Yes. The level and the distortion are separate problems, so a reply can fail both this metric and AudioClippingMetric.
When should I change the limits?
If your agent's audio is normalized to a known level, narrow the range around it, for example min_dbfs=-28, max_dbfs=-16, to catch smaller drifts from your target.
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