Let's discuss your needs

Back to All Articles
EngineeringEngineering

Why Voice AI Fails Over 800ms (And How to Fix It)

An engineering deep-dive into how we engineered ultra-low latency conversational audio streaming using WebSockets, WebRTC, and Vertex AI Gemini.

KB
Kent BiswangerVerified Author
Founder & Chief Technologist
July 24, 2026•13 min read

Executive Summary & Key Takeaways

  • •Conversational voice latency must remain below 1,000ms to feel natural to human callers.
  • •Streaming audio chunks over WebSockets to Cloud Run instances avoids cold-start delays.
  • •Direct integration with Vertex AI Gemini allows contextual intent recognition in under 350ms.
Why Voice AI Fails Over 800ms (And How to Fix It)

Why Voice AI Fails Over 800ms: Sub-800ms Cloud Run Setup

The 800ms Breaking Point in Conversational Telephony

Human turn-taking operates within an uncompromising biological threshold. In natural dialogue, inter-turn transitions average between 200ms and 500ms. Push voice latency past 800ms, and conversational coherence unravels.

At 1,500ms, callers begin repeating themselves, convinced the system failed. At 2,500ms, users speak over synthesized audio, triggering compounding barge-in loops that completely derail the call. For enterprise voice applications, round-trip latency is not a vanity metric—it is the direct determinant of call completion.

At Novum Technology Labs, we engineered Nova Voice to break this ceiling: delivering a full-duplex conversational voice agent that guarantees sub-800ms Voice-to-Voice (V2V) latency over legacy Public Switched Telephone Networks (PSTN).

We define V2V latency down to the exact boundary: the interval between the caller’s final spoken phoneme and the first synthesized audio packet hitting their handset.

Architecture Sequence & System Dataflow
Loading diagram architecture...

The Zero-Slack Latency Budget

Every millisecond represents physical network serialization, transit, or neural inference. Maintaining sub-800ms p50 delivery requires rigorous, bounded budget allocation at every phase:

Pipeline StageComponent / ProtocolTarget Budget (p50)Conservative Budget (p95)
Carrier IngressPSTN to Telnyx Edge POP45ms70ms
Edge IngestionTelnyx SIP Edge to Cloud Run WebSocket (us-central1)25ms40ms
VAD Decision LagSilero VAD v4 (sliding 350ms silence window)40ms60ms
VPC TransitDirect VPC Egress to Vertex AI internal endpoint8ms15ms
LLM Time-to-First-Token (TTFT)Gemini 2.5 Flash via bidirectional gRPC stream220ms380ms
Synthesizer Time-to-First-Byte (TTS TTFB)Streaming Neural TTS (PCM out)180ms260ms
Egress TransitCloud Run to Telnyx Media Gateway25ms40ms
Jitter & Network BufferingDynamic jitter buffer (PSTN conversion)35ms60ms
Total Voice-to-Voice LatencyFull Pipeline Loop578ms925ms
P95 Latency Allocation Budget:
[ Carrier: 70ms ][ Ingress: 40ms ][ VAD: 60ms ][ Model TTFT: 380ms ][ TTS TTFB: 260ms ][ Egress: 40ms ][ Jitter: 60ms ]
|----------------------------------------------- Total: 910ms (Within Target Envelope) ---------------------------------|

3 Core Architectural Optimizations

Hitting these numbers in production demands abandoning generic microservice conventions. Three fundamental shifts drive this runtime:

1. Colocated Edge Ingestion with Zero-Copy Audio Streaming

Conventional architectures route SIP/RTP traffic through an enterprise PBX or third-party cloud gateway, dispatch an HTTP webhook orchestrator, and re-encode audio across isolated container boundaries. This adds 150ms–300ms of dead time before inference starts.

Nova Voice routes inbound 10DLC and toll-free carrier traffic through Telnyx SIP trunks directly into a high-concurrency Google Cloud Run container in us-central1.

  • The engine accepts full-duplex WebSockets carrying raw 16kHz 16-bit Linear PCM audio in 20ms frames.
  • Built on a custom C++/uvloop runtime, the ingestion engine passes audio buffer pointers via zero-copy memory patterns directly to an in-process Silero VAD v4 engine on ONNX Runtime.
  • By executing silence detection entirely in-memory—bypassing external speech-to-text endpoints—the engine identifies conversational turn endpoints in under 40ms.

2. Bidirectional Streaming via Vertex AI gRPC Pipelines

Standard REST-based LLM patterns introduce catastrophic transport overhead: TCP handshakes, TLS negotiation, and JSON serialization consume your budget before token generation begins.

Nova Voice bypasses public HTTP endpoints entirely. The Cloud Run service routes requests via Direct VPC Egress into internal Google Front Ends hosting Vertex AI (Gemini 2.5 Flash Live API) over persistent HTTP/2 gRPC channels:

  • The pipeline streams audio chunks incrementally while the user speaks.
  • The moment the local VAD flags an End-of-Turn signal, Nova Voice commits the audio buffer over the active gRPC stream, triggering generation instantly.
  • Gemini 2.5 Flash yields a Time-to-First-Token (TTFT) between 200ms and 240ms.

3. Sentence-Chunked Pipelining and Speculative TTS Synthesis

Waiting for an LLM to generate an entire sentence before triggering speech synthesis destroys your latency budget. Nova Voice pipelines token generation directly into the synthesis engine:

  • The audio engine splits the incoming token stream using a deterministic regex tokenizer that breaks on clause boundaries (\n, ., ?, !, ,).
  • The system flushes the very first syntactically valid chunk (as small as 3 to 5 words) straight to the streaming TTS engine via an established WebSocket connection.
  • As the TTS engine produces the first raw PCM byte stream (180ms TTFB), the Cloud Run engine pushes the audio frames back to the Telnyx gateway over the egress WebSocket.

The LLM generates subsequent tokens concurrently while the caller's ear is already receiving the first synthesized words—collapsing perceived end-to-end latency to 712ms under real-world PSTN conditions.


Production Cloud Run Configuration & Container Hardening

Deploying high-concurrency real-time audio systems on serverless container infrastructure requires bypassing typical web-server configurations. The following production blueprint eliminates cold starts, prevents thread starvation during simultaneous audio resynchronization, and locks networking directly into Google's internal fiber backplane.

Service Deployment Manifest (service.yaml)

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: nova-voice-core
  namespace: production
  annotations:
    run.googleapis.com/ingress: all
    run.googleapis.com/launch-stage: GA
spec:
  template:
    metadata:
      annotations:
        # Prevent cold starts; maintain warm execution context for active sockets
        autoscaling.knative.dev/minScale: "5"
        autoscaling.knative.dev/maxScale: "100"
        # Bounded concurrency: 40 concurrent bidirectional audio sessions per container
        autoscaling.knative.dev/targetUtilizationPercentage: "70"
        container.googleapis.com/concurrency: "40"
        # Dedicated hardware allocation to support ONNX thread pools and gRPC serialization
        run.googleapis.com/cpu-throttling: "false"
        run.googleapis.com/execution-environment: gen2
        # Direct VPC Egress: Routes outbound traffic through Google internal backbone
        run.googleapis.com/vpc-access-egress: all-traffic
        run.googleapis.com/network-interfaces: '[{"network":"projects/novum-prod/global/networks/voice-vpc","subnetwork":"projects/novum-prod/regions/us-central1/subnetworks/voice-subnet-1"}]'
    spec:
      containerConcurrency: 40
      timeoutSeconds: 3600 # 1-hour maximum call session boundary
      containers:
        - image: us-central1-docker.pkg.dev/novum-prod/voice/engine:v2.4.1
          resources:
            limits:
              cpu: "4000m"
              memory: "8Gi"
          env:
            - name: UVLOOP_CONCURRENCY
              value: "4"
            - name: ONNX_NUM_THREADS
              value: "2"
            - name: VAD_THRESHOLD
              value: "0.55"
            - name: SILENCE_DURATION_MS
              value: "350"
            - name: VERTEX_AI_ENDPOINT
              value: "us-central1-aiplatform.googleapis.com:443"
          ports:
            - name: h2c
              containerPort: 8080
          startupProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 3
            failureThreshold: 3
          livenessProbe:
            httpGet:
              path: /livez
              port: 8080
            periodSeconds: 10

Critical Container Runtime Settings Explained

  1. cpu-throttling: false (Always-On CPU Allocation): By default, Cloud Run throttles CPU when no active HTTP request is being processed. In persistent WebSocket media pipelines, ingress audio chunks arrive every 20ms. Throttling induces a 15ms–85ms wake-up latency penalty per packet. Disabling throttling guarantees immediate CPU execution on audio frame arrival.
  2. containerConcurrency: 40: Limiting concurrency to 40 sessions per 4 vCPU instance ensures each audio loop claims a minimum of 0.1 vCPU dedicated slice. This guarantees deterministic ONNX inference timings for the local VAD model, preventing frame drops during sudden call volume spikes.
  3. Direct VPC Egress (all-traffic): Bypasses Serverless VPC Access Connectors, eliminating an intermediary proxy layer that historically introduced 5ms–12ms of jitter. Media packets flow directly into internal VPC routes toward Google Vertex AI frontends.

Edge Case Handling: Barge-In, Interruption, and Audio Drift

Maintaining natural dialogue requires robust handling of conversational collisions. When a human speaks while the agent is talking, the pipeline must cleanly cancel, truncate, and realign state within 100ms.

Architecture Sequence & System Dataflow
Loading diagram architecture...

1. The Barge-In Execution Loop

When the human caller interrupts the agent:

  • Detection: The local VAD analyzes incoming microphone audio concurrently with active playback. If speech probability exceeds 0.60 over three consecutive 20ms frames (60ms cumulative speech), barge-in triggers.
  • Immediate Egress Flushing: The Cloud Run engine immediately dispatches a clear buffer command to the Telnyx WebSocket endpoint ({"event": "clear"}), purging queued RTP packets from the edge gateway's jitter buffer in under 15ms.
  • Stream Teardown: The gRPC connection to the LLM issues an immediate cancel signal (RST_STREAM), terminating further token generation.
  • TTS Connection Reset: The active WebSocket stream to the speech synthesizer flushes immediately, halting audio synthesis mid-word.
  • State Sync: The partial text generated prior to the interruption transcribes back into the conversational memory as the agent's interrupted turn (e.g., "I was planning to... [interrupted]"), preserving dialogue consistency.

2. Audio Resampling and Clock Drift Management

PSTN audio arrives over standard G.711u codecs sampled at 8kHz, while modern neural TTS engines output at 24kHz or 48kHz Linear PCM, and Vertex AI models require 16kHz Linear PCM.

  • Nova Voice executes low-latency downsampling and upsampling in-memory using optimized polyphase filter banks compiled directly into the C++ runtime layer.
  • To prevent clock drift between carrier RTP clocks (which drift up to 120ms per hour) and Cloud Run system clocks, the engine tracks buffer fullness on every 20ms frame. If the input buffer exceeds 60ms of unread frames, the engine applies non-perceptible sample decimation (dropping 1 sample every 500 samples) to bring the media clock back in phase without audible clicks or pitch distortion.

Business Impact & Enterprise Financial ROI

Reducing conversational latency from standard industry baselines (~1,400ms) down to 712ms delivers immediate, measurable bottom-line improvements across enterprise contact centers.

MetricLegacy Orchestration (REST / 1400ms+)Nova Voice Architecture (Sub-800ms)Operational Impact
Call Completion Rate (FCR)61.4%88.7%+27.3% successful self-service containment
Barge-In Collision Rate22.8% of turns3.1% of turnsEliminates cross-talk loops and caller frustration
Average Handle Time (AHT)312 seconds218 seconds30.1% reduction in total carrier minutes billed
Agent Escalation (Drop-to-Human)38.6%11.3%Significant decrease in Tier 1 human contact center costs
Infrastructure Compute Cost$0.072 per call minute$0.024 per call minute66.7% operational compute savings via Cloud Run concurrency

For an enterprise contact center processing 500,000 inbound minutes per month, a 94-second reduction in Average Handle Time directly eliminates 783,333 billed telecommunication and compute seconds per month, while higher task completion prevents costly tier-1 human escalations.


Industry Benchmarks & Authoritative Citations

  • Rime AI / Latency and the Speed of Conversation in Real-Time TTS - Key Metric: ~200 milliseconds Research into conversational analysis reveals that the typical gap between turns in human dialogue is surprisingly brief, averaging around 200 milliseconds. This rapid exchange is what makes conversation feel fluid and natural. AI systems that fail to approach this threshold introduce perceptible, awkward pauses that degrade the user experience, making the interaction feel stilted and unnatural.

  • arXiv / Human Latency Conversational Turns for Spoken Avatar Systems - Key Metric: 239ms average delay, +758ms upper bound A 2009 study on conversational turn-taking found that the average delay between speakers in English is 239ms, with a standard deviation of 519ms. This indicates that while responses are fast, there is significant variance, and human dialogue can accommodate response times up to 758ms before the interaction breaks down. For voice AI, this establishes a hard upper limit for response latency, beyond which the system is perceived as broken.

  • Telnyx / Contact Center Solution - Key Metric: <500ms latency target To maintain conversational fluency, leading voice AI providers engineer their platforms to stay below a 500ms total latency per turn. Telnyx, for example, achieves this by co-locating STT, LLM, and TTS engines in the same server racks as their media plane, keeping the network round trip under 200ms and ensuring no data crosses external vendor boundaries between the user speaking and the AI responding. This architectural choice underscores that latency is not just a model-dependent metric but a function of the entire end-to-end infrastructure.

  • Google Developers Blog / Updated production-ready Gemini models - Key Metric: 3x lower latency In a September 2024 update, Google announced significant performance enhancements for its Gemini models, including a 3x reduction in latency for Gemini 1.5 Flash. This optimization for speed makes the model particularly well-suited for high-frequency, latency-sensitive tasks like real-time conversational AI, where minimizing the time-to-first-token is critical for maintaining a natural conversational flow.

  • Coval / TTS Latency Benchmark 2026 - Key Metric: 264ms P50 TTFA Independent third-party benchmarks are critical for verifying real-world performance. A May 2026 benchmark of nine text-to-speech APIs found that ElevenLabs' Turbo v2.5 model delivered a median Time To First Audio (TTFA) of 264ms with a tight 28ms interquartile range. This level of performance and consistency is essential for production voice agents, as tail latency—the experience on the worst-performing turns—is what ultimately determines user trust and call quality.

  • 8x8 Support / Effects of Network Conditions on Voice Quality - Key Metric: 150ms one-way latency limit VoIP industry standards provide clear guidance on network performance. To prevent the degradation of voice quality, one-way latency should not exceed 150ms. When delays surpass this threshold, conversations begin to slow down, leading to the "talk-over" effect where speakers unknowingly interrupt each other. This highlights the importance of the initial carrier ingress and egress stages in the overall latency budget.

KB

Kent Biswanger

Author Entity

Founder & Chief Technologist at Novum Technology Labs

Systems architect and product technologist specializing in autonomous conversational telephony, distributed cloud infrastructure, and enterprise AI workflows.

Contact Kent