← notes[drafting]touched 2026-10-11#voice#ai#pydantic-ai#learning

Voice Agents from First Principles

How a machine hears you, decides you're done, understands you, thinks and answers out loud. Samples, turn-taking, speech recognition, agents and speech synthesis, built up byte by byte.

I want to build a voice app where someone practises a difficult conversation with an AI role-play partner. That only works if I understand every layer underneath, especially silence and timing, so this track is general: no product, no vendor, just how it works.

1. Audio as data

Every voice agent starts the same way: sound goes in, and the code gets numbers. This chapter follows that path step by step, from a sound wave to the input a speech model actually reads. Each step answers the question the previous one raises.

Sound in three sentences

Sound is air pressure going up and down very quickly. Something vibrates, like vocal cords or a loudspeaker, and those pressure changes travel through the air to your ear. Plot the pressure at one spot over time and you get a smooth wave.

That wave is continuous: between any two moments there is always another moment with its own value, so the wave holds infinitely many values. A computer can only store a finite list of numbers.

So how do we turn the wave into numbers?

Want the full picture? This optional video goes deeper: pressure, the Slinky, frequency, overtones, microphones and vinyl records. You don't need it for the rest of this note.

What is sound? (2:46). Turn the sound on: what you hear always matches what you see.

For an interactive read, Sound by Bartosz Ciechanowski is beautiful.

From wave to numbers

It takes two devices. A microphone turns the pressure wave into an electrical signal with the same shape. Then an ADC (analog-to-digital converter) measures that signal at fixed time steps and writes each measurement down as a number. This is called sampling, and each measurement is a sample.

sound wave → microphone → electrical signal → ADC → [0.0, 0.12, 0.31, 0.18, -0.05, ...]
                                              measures at fixed time steps

How often do we measure?

Paused here. I'm reading Hugging Face Audio Course, Unit 1: Introduction to audio data first. This chapter continues from that.