Lab 3: From a recording to minutes¶
Turn a meeting recording into a timestamped transcript, then into minutes with decisions, owners and dates. Then work out how fast a voice assistant needs to be.
| When | Day 1 (about 30 minutes, hands-on) |
| Lab file | labs/03-audio-to-minutes.ts, run with npm run lab3 -- <step> |
| Files used | data/meeting.wav (or your own recording), data/meeting_script.txt |
What you'll build¶
Step 0: Find the audio¶
Do: open labs/03-audio-to-minutes.ts in your editor. Every run prints Audio file: .../data/meeting.wav. Open that file in any audio player and listen for a few seconds: a meeting about a claims OCR pilot.
Warning
No audio file? Run npm run make-audio (Mac and Windows). Otherwise open data/meeting_script.txt, record yourself reading it on your phone (about 1 minute), and copy it to data/meeting.wav or data/meeting.m4a. Then run the lab again.
Step 1: Speech to text¶
Do: npm run lab3 -- 1.
You should see which method was used, how long it took, and timestamped lines:
backend=local took 21.4s
[ 0.0- 5.2] Okay, let's start. This is the weekly sync for the claims OCR pilot...
[ 5.2- 10.9] Thanks. Quick update: extraction accuracy on printed invoices is now...
...
backend=localmeans Whisper ran on your laptop (through Transformers.js): the recording never left it..m4aand.mp3files are converted to WAV first, also on your laptop.backend=openaiorgeminimeans your provider's speech service was used (change the call ingetTranscript()to try it).
The transcript is saved, so later steps don't transcribe again. Step 1 always makes a fresh one.
Why it matters: this is the same idea as auto-captions on a video. Running it locally matters when recordings can't leave your company's network.
Step 2: Label who spoke¶
Do: npm run lab3 -- 2. It asks the model to label each line MANAGER or ENGINEER based on what is said.
You should see the transcript again, with each line starting MANAGER: or ENGINEER:.
Why it matters: knowing who said what makes the minutes useful. This shortcut guesses from content, not from the voices. Real speaker separation ("diarisation") uses a dedicated model or a speech API that returns speaker labels. Be honest with stakeholders when a label is a guess.
Step 3: Turn it into minutes¶
Do: npm run lab3 -- 3. It uses the Minutes schema (a Zod object in the file) and fills it from the labelled transcript.
You should see JSON like this:
{
"meeting_title": "Claims OCR pilot weekly sync",
"date": "2 December",
"decisions": ["Keep human review for claims above Rs 5 lakh",
"Use only the on-prem model for customer identity data until Legal clears external APIs"],
"action_items": [
{"owner": "Rahul", "task": "Add a table detection step", "due": "Friday"},
{"owner": "Engineer", "task": "Build a 50-document gold set from November claims", "due": "Next Wednesday"}
],
"risks": ["Legal has not cleared sending scans to an external API"],
"metrics_mentioned": {"printed invoice accuracy": "96%", "handwritten form accuracy": "82%"}
}
Check it against the script (data/meeting_script.txt):
| Should appear | In the script |
|---|---|
| Rahul, table detection, by Friday | ✔ |
| 50-document gold set, by next Wednesday | ✔ |
| Human review above Rs 5 lakh | ✔ |
| Legal hasn't cleared external APIs | ✔ |
| Demo to the business on the 12th | ✔ (some models put this under decisions or leave it out) |
Success
Checkpoint: your minutes name Rahul and the gold set with their due dates, and nothing appears that wasn't said.
Step 4: Work out the latency budget for a voice assistant¶
A voice assistant feels natural if it starts answering within about 0.8 seconds of you finishing speaking.
Do: npm run lab3 -- 4. It measures your speech-to-text and model speed, and adds typical figures for the other steps.
You should see a table like:
end-of-speech detection (VAD) 0.25s
speech-to-text (streaming, per turn) 0.90s
LLM first token 1.80s
text-to-speech first audio 0.20s
network round trips 0.10s
TOTAL 3.25s (target ≤ 0.8s)
Batch STT real-time factor: 0.31 (below 1 = faster than real time)
Why it matters: look at which line is biggest. That's where a real voice product needs work: streaming transcription, a faster model, saying "let me check" while it thinks, or a speech-to-speech model that skips the text step.
Step 5 (Gemini users only): Ask the audio directly¶
Do: if your provider is Gemini, run npm run lab3 -- 5. Others will see a message saying how to switch.
You should see an answer about who sounds less certain, and about what.
Why it matters: skipping the transcript can capture tone and hesitation, but you lose the written record that auditors and colleagues rely on.
Your turn (if you finish early)¶
Add each exercise as a new step (6, 7, 8) at the Your turn comment in the lab file, then run it with npm run lab3 -- 6.
1. Minutes in Hindi or Marathi. Translate the minutes and check that names, numbers and dates survived.
Hint
6: {
title: "Minutes in Hindi", run: async () => {
const minutes = await askJson("Turn this meeting transcript into minutes. Only include what was actually said.\n\n"
+ await labelled(), { schema: Minutes }); // saved answer: no new call
console.log(await ask("Translate these meeting minutes into Hindi. Keep names, numbers, amounts and dates " +
"exactly as they are.\n\n" + JSON.stringify(minutes, null, 2)));
},
},
Check that "Rahul", "50" and "5 lakh" come through unchanged.
2. Hide personal data first. Before summarising, mask anything that looks like a phone number, OTP or card number.
Hint
7: {
title: "Hide personal data first", run: async () => {
const mask = (text: string) => text
.replace(/\b(?:\d[ -]?){13,16}\b/g, "[CARD]") // card numbers
.replace(/(\+91[\s-]?)?[6-9]\d{4}\s?\d{5}/g, "[PHONE]") // Indian mobile numbers
.replace(/\b\d{6}\b/g, "[OTP]"); // 6-digit codes
console.log(mask("Call me on +91 98220 12345, OTP is 482913, card 4111 1111 1111 1111"));
const safe = await askJson("Turn this meeting transcript into minutes. Only include what was actually said.\n\n"
+ mask(await labelled()), { schema: Minutes });
console.log(safe);
},
},
Masking runs in your own code on your laptop, so the model never sees the original numbers. Note that the 6-digit rule also hides any 6-digit amount: real systems need more careful rules.
3. Stretch: Hinglish. Record a 20-second clip mixing Hindi and English, save it as data/hinglish.m4a, and compare the local and API transcripts.
Hint
8: {
title: "Hinglish: local vs API", run: async () => {
const local = await transcribe("data/hinglish.m4a", "local");
const api = await transcribe("data/hinglish.m4a", "openai"); // or "gemini"
console.log("LOCAL:", local.seconds, "s\n", local.text);
console.log("API: ", api.seconds, "s\n", api.text);
},
},
Key takeaways¶
- Speech-to-text first gives you an auditable record; local Whisper keeps recordings on your laptop.
- Structured minutes follow the same pattern as Lab 2: a schema, filled only from what was said.
- Speaker labels from content are a guess; say so.
- For live voice, latency decides the experience. Measure every step.
Stuck?¶
Error: No recording found: see the warning box in Step 0.- Transcription is very slow: local Whisper on an older laptop can take longer than the recording itself. Add
LOCAL_WHISPER_MODEL=Xenova/whisper-baseto.envand run Step 1 again, or change the call ingetTranscript()totranscribe(AUDIO!, "openai"). - The minutes include things nobody said: run Step 3 again and check the prompt still says "Only include what was actually said". Point it out in the discussion; it's a good example of a hallucination.