Skip to content
Visual explainer 3h to learn 5 steps

Versioned transcript and synthetic audio fixtures for voice agents

Build a versioned set of transcript and synthetic audio cases covering silence, interruption, ambiguous times, accents, denial and handoff.

By Invicly Tech, , in n8n, AI Automation and Voice Agents. About 9 minutes to read.

Topic 34 of 43

In short

A fixture is a saved test case you can run again and again. For a voice agent, each fixture holds what the caller says, what the agent should do, and the rules for passing. You write the text first, make audio from it later, and keep every set under version control.

Think of it like this: A fixture set is like a driving test route: the same roads every time, so a change in your driving shows up as a change in the score.

Explained simply

A voice agent talks to people, and people are unpredictable. They go quiet, talk over the agent, say next Friday after lunch, or ask for a human. You cannot wait for these to happen live. You write them down as test cases and run them on purpose.

Each test case is called a fixture. It has the words the caller says, what the agent should do, and what it must not do. Start with plain text. Text is quick to write, free to run and easy to compare.

Later you turn the text into audio with a text to speech service. This tests the whole voice path, including speech recognition. Synthetic voices are cleaner than a real phone line, so treat audio results as a good sign, not a promise.

Keep the whole set in Git with a version number. When a score changes, you can check whether the agent changed or the tests did. Use invented names and numbers only, never a real recording.

Press Play on a diagram to walk through it one step at a time.

FlowFrom a written case to a versioned fixture set
  1. 1
    Write transcript case

    Caller lines, expected tool calls, expected outcome

  2. 2
    Add edge tags

    Silence, interruption, vague time, accent, denial, handoff

  3. 3
    Generate synthetic audio

    Text to speech from the transcript, optional

  4. 4
    Store with a version

    Fixture set v1.2.0 in Git

  5. 5
    Replay on each change

    Same cases, compare scores

CompareTranscript fixture or audio fixture
Transcript fixture
  • Fast and free to run
  • Tests the logic and the tools
  • Exact and repeatable
  • Misses speech recognition errors
Audio fixture
  • Tests the whole voice path
  • Slower and may cost money
  • Catches accent and noise problems
  • Synthetic voices are cleaner than real calls
SequenceA fixture replayed against the agent
Test runner
Agent under test
Mock tools
  1. 1Caller turn from the fixture
    Test runner to Agent under test: Caller turn from the fixture
  2. 2check_availability call
    Agent under test to Mock tools: check_availability call
  3. 3Fixed list of slots
    Mock tools to Agent under test: Fixed list of slots
  4. 4Agent reply text
    Agent under test to Test runner: Agent reply text
  5. 5Compare reply and calls to expected
    Test runner to Test runner: Compare reply and calls to expected

In depth

What makes a good fixture

A fixture should be small, specific and checkable. One case tests one behaviour. It lists the caller turns, the tools the agent may call, and the result you expect. It also lists what must never happen, such as creating a booking before the caller confirms. Give every case an ID and tags so you can run a group, for example all interruption cases. If a person cannot tell from the case whether the agent passed, a script cannot either.

  • One behaviour per case
  • Expected tool calls and arguments
  • A must-not list for unsafe actions
  • Stable ID and tags
  • No real personal data

The edge cases that matter

Happy paths teach you little. Cover silence, where the caller says nothing for several seconds. Cover interruption, where the caller speaks while the agent is talking. Cover ambiguous times, such as next Friday or around three. Cover accents and unclear speech by using different synthetic voices. Cover a denied permission, such as a caller refusing to confirm. Cover a handoff request, where the agent must stop and pass the call to a person. Each one has a clear right answer, even if that answer is to ask a question.

  • Silence and long pauses
  • Barge-in interruptions
  • Vague dates and times
  • Different voices and accents
  • Refusal and handoff
MapA fixture set organised by edge case
Fixture set 1.2.0
  • Timing
    • Silence
    • Interruption
    • Late reply
  • Meaning
    • Ambiguous time
    • Two dates in one sentence
  • Voice
    • Accent A
    • Accent B
    • Noisy line
  • Control
    • Permission denied
    • Handoff request

Generating and storing audio

A text to speech service turns each caller line into an audio file. Some providers charge per character, so check the current price page, or use a local open source voice for free. Store the audio next to the transcript, named by case ID and voice. Do not regenerate it every run, because voices can change when a provider updates a model. Pin the file and record which voice and date made it. In n8n you can also pin sample data on a node to replay it without calling the live service.

Versioning the set

Treat the fixture set like code. Use a version number: bump the patch for a typo, the minor number for new cases, and the major number when expected results change. Write one line in a changelog per change. Every score report should say which set version it used. That one habit prevents the confusing argument about whether the agent got worse or the test got harder.

CycleFixture set maintenance loop
  1. 1
    Find a real failure

    From a redacted incident

  2. 2
    Write a new case

    Invented data only

  3. 3
    Bump the version

    Add a changelog line

  4. 4
    Replay everything

    Check old cases still pass

  5. Back to step 1

Learn it in 5 short steps

About 35m each. Track them with a timer in your plan.

  1. 1
    Write transcript-first cases~35m
  2. 2
    Generate synthetic audio~35m
  3. 3
    Cover silence and interruption~35m
  4. 4
    Cover ambiguous times and accents~35m
  5. 5
    Version the fixture set~35m

Key points

  • Write transcript-first: every case starts as plain text with an expected outcome.
  • Cover the awkward cases on purpose: silence, interruption, ambiguous times like next Friday morning, accents, refused permission and a request for a human.
  • Synthetic audio from text to speech is a cheap way to test the audio path, but it is cleaner than a real phone line.
  • Version the whole set with a number and a changelog, so a score change can be traced to either the agent or the fixtures.
  • Use only invented people and numbers. Never put real caller recordings in a fixture set.

Key terms

Tap a card to flip it. 0/5 known

Examples

json
{
  "id": "ambiguous-time-001",
  "set": "1.2.0",
  "tags": ["ambiguous-time"],
  "turns": [
    { "caller": "Can I come in next Friday, sometime after lunch?" }
  ],
  "expect": {
    "tool_calls": ["check_availability"],
    "must_ask": "which date and what time",
    "must_not": ["create_booking"]
  }
}

One transcript-first fixture, with invented data.

A silence case

The caller says one word and then nothing. The agent should wait, prompt once, then offer a human. It must not guess a time. The fixture records a short and a long gap so you can test both.

json
{
  "id": "silence-002",
  "tags": ["silence"],
  "turns": [
    { "caller": "Hi, I want to book." },
    { "caller": "", "silence_ms": 8000 }
  ],
  "expect": {
    "agent_says_contains": "still there",
    "must_not": ["create_booking"]
  }
}

Making audio from a case

You loop over the fixtures, send each caller line to a text to speech service, and save the file by case ID. The command below is a placeholder script, with the provider details left for you to fill in from its current docs.

bash
for f in fixtures/v1.2.0/*.json; do
  id=$(basename "$f" .json)
  node scripts/tts.js "$f" --voice voiceA \
    --out "audio/v1.2.0/$id.voiceA.wav"
done
git add audio fixtures
git commit -m "Fixture set 1.2.0 with audio"

Quick reference

  • Write transcript cases first, add audio second.
  • One behaviour per fixture, with a must-not list.
  • Cover silence, interruption, vague times, accents, refusal, handoff.
  • Version the set and put the version in every score report.
  • Pin generated audio; do not regenerate it on each run.
  • Invented data only: example.com, fake names, fake numbers.

Common mistakes

  • Only testing the happy path, so the first real interruption breaks the agent.
  • Changing a fixture without bumping the version, which makes old and new scores look comparable when they are not.
  • Using a real customer recording because it is handy. That is personal data in your repository.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Why start with transcript fixtures?

Question 2

2A fixture says the agent must not call create_booking. What is that called here?

Question 3

3When should you bump the major version of a fixture set?

Question 4

4Why pin generated audio files?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Write one transcript fixture for a caller who says Book me for next Friday morning. State the expected behaviour.

  2. Exercise 2medium

    List six fixtures that together cover silence, interruption, an accent, refusal and a handoff request. Give each an ID and tags.

  3. Exercise 3hard

    Design a folder layout and changelog for fixture set 1.3.0 that adds three interruption cases and changes one expected result.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Do I need real call recordings to test a voice agent?
No. Write invented cases and use synthetic audio. Real recordings are personal data and should not sit in a repository.
How many fixtures are enough?
Start with one per edge case, around 20 to 30, and add a new case each time a real failure teaches you something.
Is synthetic audio a good test of real callers?
It tests the audio path, but it is cleaner than a real phone line, so also try some noise and several voices.

Go deeper

ShareXLinkedInWhatsApp