Speaking Rate
The speaking rate metric checks whether your voice agent talks at a comfortable pace, neither rushing through a reply nor dragging it out. It returns the share of agent replies spoken at a normal rate, between 0 and 1.
Required Arguments
To use the SpeakingRateMetric, you'll have to provide a ConversationalTestCase with:
audioon the agent's turns, one clip per reply, or on the test case as a stereo recording of the whole call*
The rate is counted from the audio alone. With per-turn audio, each turn's content is read too, but only to skip replies that spell something out.
* 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 SpeakingRateMetric() 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 SpeakingRateMetric
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 = SpeakingRateMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])There are FOUR optional parameters specific to the SpeakingRateMetric, on top of the common voice metric parameters:
- [Optional]
min_syllables_per_second: a float for the slowest rate, in syllables a second, a reply may be spoken at. Must be 0 or more. Defaulted to3.5. - [Optional]
max_syllables_per_second: a float for the fastest rate, in syllables a second, a reply may be spoken at. Must be greater thanmin_syllables_per_second. Defaulted to10.0. - [Optional]
eval_mode:"deterministic"or"hybrid". In"hybrid", each flagged reply is double-checked by an audio decision model before it counts. Defaulted to the configured voice eval mode ("deterministic"unless set). - [Optional]
audio_decision_model: the model that does the second check in"hybrid"mode. Defaulted toHumeDecisionModel().
A value outside these limits raises a ValueError.
As a standalone
You can also run the SpeakingRateMetric 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 spoken too fast or too slowly shows up in score_breakdown. Here is what the example call returns:
{
"eligible_turns": 4,
"turns_with_events": 2,
"events": [
{
"type": "too_fast",
"turn": 3,
"timing_source": "turn_timestamps",
"description": "Agent spoke too fast (12.1 syllables a second)",
"syllables_per_second": 12.1,
"offset_seconds": 0.0,
"duration_seconds": 4.0,
"start_time": 9.5,
"mark": "whole_reply",
},
{
"type": "too_slow",
"turn": 7,
"timing_source": "turn_timestamps",
"description": "Agent spoke too slowly (2.6 syllables a second)",
"syllables_per_second": 2.6,
"offset_seconds": 0.0,
"duration_seconds": 6.0,
"start_time": 23.5,
"mark": "whole_reply",
},
],
"skipped": [
{"turn": 5, "error": "Reply spells something out."},
{"turn": 9, "error": "Reply has under 2 seconds of speech."},
],
}| Field | What it means |
|---|---|
type | Too fast if over max_syllables_per_second, too slow if under min_syllables_per_second |
syllables_per_second | The reply's rate, in syllables a second of speaking time |
Each event covers the whole reply: offset_seconds is 0 and duration_seconds is the clip's length. Replies with under 2 seconds of speaking time, replies that spell something out, and audio 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 too fast or too slow. The score is the share that were neither.
How Is It Calculated?
The SpeakingRateMetric score is calculated according to the following equation:
The metric reads per-turn audio, one agent clip at a time, or replies cut from stereo full call audio when no turn has audio. The caller's turns are never checked.
Which replies are scored
A reply is scored if it has at least 2 seconds of speaking time. Speaking time runs from the first to the last moment the clip is louder than silence (about −41 dBFS), minus any pause of 200 ms or more inside it. That way an agent that stops to look something up isn't counted as talking slowly.
With per-turn audio, a reply is also skipped when its content spells something out, since a name or a code read letter by letter is slow on purpose. That is:
- three single letters or digits in a row, such as "B, Y, R" or "4 7 2",
- a letter given by a word, such as "B as in Boy", or
- a code of 6 or more characters with a digit in it, such as "SH5216742".
With full call audio and no per-turn audio, the turns' text can't be matched to the replies heard, so this check is off.
Rate criteria
Syllables are counted from the audio, not the text: each rise in the reply's loudness that stands at least 3 dB above the dips on both sides is one syllable (de Jong & Wempe, 2009). The rate is the syllables divided by the speaking time.
| Check | Rule |
|---|---|
| Too fast | Over max_syllables_per_second (10 by default) |
| Too slow | Under min_syllables_per_second (3.5 by default) |
If no agent reply has enough speaking time, the metric is skipped.
Second check
In the hybrid eval mode, the metric also flags replies within 1.5 syllables a second of either limit (under 5 or over 8.5 by default), since the syllable count alone can't tell those from normal speech. Each flagged reply is then double-checked before it counts. The audio decision model hears the agent's whole reply, from that turn's own clip, or from the reply cut from full call audio when no turn has audio, and is asked:
- Too slow: "Is the speaker talking unnaturally slowly?"
- Too fast: "Is the speaker talking unnaturally fast?"
If the model judges "no" more likely than "yes", the reply is dismissed and doesn't count against the score.
If the model can't be reached, a reply only the wider band flagged doesn't count, and a reply outside the limits still does.
Example call
A call with six agent replies: one spells out a booking reference and one is too short. Each row is one agent reply and its rate.
| Agent turn | Text | Rate | Flagged? |
|---|---|---|---|
| 1 | "Sure, I can look that order up for you right now." | 6.1 syllables a second | No |
| 3 | "Your order shipped on Monday and should arrive by Thursday, so keep an eye out." | 12.1 syllables a second | Yes (too_fast) |
| 5 | "That is B, Y, R, for your booking reference." | Skipped, spells something out | |
| 7 | "Is there anything else I can help you with?" | 2.6 syllables a second | Yes (too_slow) |
| 9 | "Okay." | Under 2 s of speech | Skipped |
| 11 | "Thanks for calling, and have a great day." | 5.1 syllables a second | No |
| 4 replies | 2 flagged → 2/4 = 0.5 |
FAQs
Why syllables rather than words per minute?
Does this metric call an LLM or an external speech model?
"hybrid" eval mode, each flagged reply is also checked by an audio decision model, at one paid request per flagged reply.