Skip to content
Visual explainer 3h to learn 5 steps

Transcription, synthesis and turn-taking in voice agents

Explain transcription, synthesis, streaming and turn detection, and run a transcript-first or push-to-talk exercise that handles silence and interruptions.

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

Topic 22 of 43

In short

Transcription turns audio into text, and synthesis turns text into audio. Both work best when streamed in small chunks so the caller does not wait for a full sentence. Turn detection decides when the caller has finished, and it must cope with silence and interruptions.

Think of it like this: Turn detection is like knowing when a friend has finished a sentence, without cutting in too early or leaving an awkward gap.

Explained simply

Transcription means turning speech into text. Synthesis means turning text into speech. A voice agent uses one or both, depending on how it is built.

Streaming means sending small pieces as soon as they exist. If the agent waited to finish a whole sentence before speaking, the caller would sit in silence. By streaming audio out in chunks, the first words come quickly.

The hard part is knowing when someone has finished talking. Software looks for a pause, and some systems also look at meaning. Too eager, and it cuts people off. Too slow, and there is an awkward gap.

Callers also interrupt. When they do, the agent should stop talking and listen. And when the line goes quiet, the agent should check in once, gently, rather than talk forever.

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

CycleOne turn of a conversation
  1. 1
    Listen

    Audio streams in while the caller speaks.

  2. 2
    Detect end of turn

    Pause or meaning signals they are done.

  3. 3
    Think

    Transcript goes to the model and tools.

  4. 4
    Speak

    Reply audio streams out in chunks.

  5. 5
    Watch for barge-in

    If the caller talks, stop speaking.

  6. Back to step 1
SequenceHandling an interruption
Caller
Voice gateway
Agent
  1. 1Start streaming reply audio
    Agent to Voice gateway: Start streaming reply audio
  2. 2Play first words
    Voice gateway to Caller: Play first words
  3. 3Caller starts speaking
    Caller to Voice gateway: Caller starts speaking
  4. 4Barge-in: cancel reply
    Voice gateway to Agent: Barge-in: cancel reply
  5. 5Clear queued audio
    Voice gateway to Voice gateway: Clear queued audio
  6. 6New caller turn arrives
    Caller to Agent: New caller turn arrives

In depth

Streaming in both directions

Audio flows in as the caller speaks, so the transcript can start forming before the turn ends. Audio also flows out as the reply is made, so playback can begin early. The important idea is that nothing waits for the whole message. The cost is more moving parts: chunks arrive out of step, and a late chunk can be useless if the caller already interrupted.

  • Inbound audio chunks feed transcription
  • Outbound audio chunks feed playback
  • Late chunks after an interruption should be dropped

Detecting the end of a turn

Voice activity detection checks whether sound is speech. A simple rule says the turn ended after a set number of milliseconds of silence. Better systems also judge whether the sentence sounds complete, so a pause in the middle of an address does not end the turn. You normally tune a threshold: shorter feels quick but risks cutting in, longer feels polite but slow. Test with real pauses, such as reading out a phone number.

CompareTurn detection tuning
Short silence threshold
  • Fast replies
  • Cuts off slow speakers
  • More false turn ends
Long silence threshold
  • Patient with pauses
  • Feels slow
  • Callers may repeat themselves

Silence and interruptions

For silence, set a first prompt after a few seconds, a second shorter prompt, then end politely or offer a person. For interruptions, stop playback at once, discard queued audio and treat the new speech as the next turn. Also remember what was already said, because the caller only heard part of the reply. If your system tracks that, it can avoid repeating or skipping facts.

Practising without live audio

You can test the logic without a microphone. In a transcript-first exercise you feed typed turns, including empty ones for silence and overlapping ones for interruptions, and check the agent's replies. In a push-to-talk exercise, a person holds a key while speaking, which removes turn detection as a variable.

Learn it in 5 short steps

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

  1. 1
    Transcribe and synthesise speech~35m
  2. 2
    Stream audio in both directions~35m
  3. 3
    Detect the end of a turn~35m
  4. 4
    Handle silence and interruptions~35m
  5. 5
    Run a push-to-talk exercise~35m

Key points

  • Stream audio in both directions so speech starts before the whole reply is ready.
  • Voice activity detection (VAD) finds speech and silence. Some systems also use meaning to judge the end of a turn.
  • A barge-in is the caller interrupting. Stop playback and listen.
  • Handle long silence with a gentle prompt, then a polite exit.
  • Practise with push-to-talk or a transcript-first test before using live audio.

Key terms

Tap a card to flip it. 0/5 known

Examples

A push-to-talk exercise

Prerequisites: a laptop, a microphone and a speech-to-text provider or a free local tool. Steps: hold a key, speak a booking request, release, and print the transcript. Evidence: the transcript matches what you said. Cleanup: delete any recorded audio files from the test folder.

A transcript-first silence test

Feed the agent typed turns where one is empty. The agent should prompt once, then offer a person on the second empty turn.

python
turns = ["I need an appointment", "", ""]
for i, t in enumerate(turns):
    if t.strip():
        reply = agent(t)
    elif i == 1:
        reply = "Are you still there?"
    else:
        reply = "I will connect you to a person."
    print(reply)

Quick reference

  • Transcription: speech to text. Synthesis: text to speech.
  • Stream audio in chunks so replies start early.
  • VAD detects speech versus silence.
  • Shorter silence threshold is quicker but cuts people off.
  • On barge-in, stop playback and clear queued audio.
  • Prompt once on silence, then offer a person.

Common mistakes

  • Setting the silence threshold so short that the assistant cuts callers off mid-thought.
  • Not clearing queued audio on barge-in, so the assistant keeps talking over the caller.
  • Testing only with clean, quiet recordings.

Quick quiz

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

Question 1

1Why stream outbound audio?

Question 2

2What does VAD do?

Question 3

3What happens if the silence threshold is too short?

Question 4

4What should you do with queued reply audio on a barge-in?

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 down the five steps of one conversation turn.

  2. Exercise 2medium

    Write transcript-first test cases for silence and interruption.

  3. Exercise 3hard

    Design a policy table for end-of-turn thresholds for names, dates and phone numbers.

Check yourself

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

Feel confident about this topic?

Frequently asked questions

What is barge-in?
It is when the caller speaks over the assistant. The assistant should stop and listen.
Is a longer silence threshold always safer?
No. It avoids cutting people off but makes the agent feel slow. Tune it with real calls.
Can I test without a microphone?
Yes. Use typed turns, including empty ones for silence, then try push-to-talk before live audio.

Go deeper

ShareXLinkedInWhatsApp