Nina Castell

Nina Castell

Engineering writer, Protoface

Nina Castell writes Protofaceโ€™s engineering guides for developers building realtime AI avatars and voice agents.

Her articles cover media transport, LiveKit and Pipecat pipelines, latency, interruption handling and multilingual voice, with working code for each framework.

Articles by Nina

A video game innkeeper character behind the bar of a candlelit medieval tavern

AI NPCs in Games: How They Work and How to Build One

You want a character that answers whatever the player says. Build the loop in order: text, game state, voice, then a face.

Cover showing the three AI video pricing models: subscription, pay as you go credits and API billing

AI Video Generator Pricing: Quotas, Credits and Budgets

You are choosing or budgeting for an AI video tool. Compare how each one charges, then work out what a finished minute costs your team.

Two neon speech bubbles, one pink and one blue, glowing on a dark brick wall

Code-Switching in Voice Agents: Handling Mixed Languages

Your callers mix two languages in one sentence and the agent trips. Fix it stage by stage, then prove it with a test set you can rerun.

A hand holding a phone on a video call in a sunny city park

Flutter WebRTC: Connecting an App to a Realtime Avatar

You have a Flutter app and a voice agent. Set up WebRTC on both platforms, then put a live avatar on screen without writing a signaling server.

Cover showing the three steps to add a realtime AI avatar to a React or Angular app: token, connect, attach

How to Add a Realtime AI Avatar to a React or Angular App

You have a voice agent and a front end. Give the agent a live face with one token endpoint, one hook or service, and one video element.

Cover showing what WebRTC encrypts by default and what the application has to secure itself

Is WebRTC Secure? Encryption, Auth and Safe Embeds

The media is encrypted before you write a line of code. Your work is deciding who gets a token, what the browser can see and where an embed may run.

Cover comparing LiveKit as a media platform with a raw WebSocket as a pipe, and when to pick each

LiveKit vs WebSocket for Realtime Voice and Video Apps

You need live audio between a user and an agent. Decide whether a managed room or your own socket carries it, and what each one leaves you to build.

Aerial view of a railway yard where one track splits into many

Load Balancing WebRTC Sessions Across Servers

One media server is full and you need a second. Split signaling from media, pin each session to a server, and scale without cutting live calls.

Cover comparing the OpenAI Realtime API as one speech-to-speech model with a chained STT, LLM and TTS pipeline

OpenAI Realtime API vs STT + LLM + TTS Pipelines

You need a voice agent that answers fast and sounds right. Pick the architecture by what you must control, then put a face on it.

Round analog gauges on an aircraft cockpit instrument panel

OpenTelemetry for GenAI Voice and Avatar Apps

Your agent feels slow and you cannot say which stage is to blame. Trace each turn with standard GenAI spans and add the avatar spans the conventions leave out.

An antique desk globe lit by a spotlight in a dark library

Pipecat Multilingual Voices: English, Spanish, French

Your Pipecat agent answers Spanish and French callers in an English voice. Detect the language per turn and switch voice, prompt and avatar audio with it.

A toy crab, a keyboard and a small circuit board laid out on a dark green mat

Rust WebRTC: Streaming a Realtime AI Avatar

Your Rust service has to put live audio and video in a browser. Pick the crate, write the signaling, and send real media.

Strips of 35mm film on a lightbox with a magnifying loupe

Sending Video Frames over WebRTC: Python and Node Guide

Your server renders frames and a browser has to play them live. Put them on a video track, and WebRTC handles encoding, pacing and loss.

Five different microphones standing in a row on a pink backdrop

Vapi Voices: Multi-Voice Setup for Realtime AI Avatars

You need the right voice on a Vapi assistant, maybe more than one, and a face that keeps up. Pick the voice, set it, then hand off between voices.

Cover showing five viseme mouth shapes and the speech sounds each one covers

Visemes Explained: Real-Time Lip Sync for AI Avatars

Your avatar's mouth has to match the words. Learn the mouth shapes, where to get them, and how to keep them on the audio clock.

Cover showing what voice activity detection does and its two uses in a voice agent: end of turn and barge-in

Voice Activity Detection: How Voice Agents Handle Barge-In

Your agent cuts people off, or keeps talking when they interrupt. Both come down to how it detects speech and what it cancels when it does.

A lone microphone on a stand in a large empty concrete hall lit by sunbeams

WebRTC Echo Cancellation: How It Works and Fails

Your users hear themselves, or your voice agent keeps interrupting itself. Find out what the browser cancels, what it cannot, and how to fix the route.

A stopwatch lying on the lane line of a red running track

WebRTC Latency: How to Measure and Reduce It

Your call or avatar feels slow and you do not know which stage to blame. Measure each one in the browser, then fix the largest first.

The same landscape photograph hung at three sizes on a white gallery wall

WebRTC Simulcast: Bandwidth Adaptation for Live Video

Some of your viewers are on fiber and some are on a train. Send three layers, let the SFU pick one per viewer, and check that each layer is really on the wire.

Hands testing a circuit board with multimeter probes under a desk lamp

WebRTC Troubleshooting: ICE, Autoplay and Audio Failures

Your call will not connect, or it connects and stays silent. Find the layer that failed in a few minutes, then apply the matching fix.

Cover comparing WebRTC over UDP for live audio and video with WebSocket over TCP for ordered data, and using both together

WebRTC vs WebSocket: Which to Use for Realtime AI

You are picking a transport for a voice agent or avatar. Decide by what travels on each hop, then wire the two together.

Cover comparing three WebRTC architectures: P2P mesh, SFU and MCU

What Is a WebRTC SFU? SFU vs P2P vs MCU Explained

You are deciding how media should flow in a call, maybe one with an AI agent or avatar in it. Count the endpoints, then pick the topology.