Tutorial
Transcribe and summarise audio locally with faster-whisper
Transcribe audio locally with faster-whisper in Python, fix misheard names, then summarise the transcript with a local model through Ollama, all offline.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
This tutorial builds two small Python scripts that turn a recording into notes without sending anything off your machine. transcribe.py uses faster-whisper to write a transcript with a timestamp on every line, and summarise.py sends that transcript to a local model through Ollama and gets back decisions, actions and open questions, each pointing at the line that supports it. Along the way you will see why Whisper mishears names and how to fix it, why the summariser asks for timestamps, and how to split a long transcript so it fits the model’s context.
It was written and run on CPU against faster-whisper 1.2.1, PyAV 18.1.1, piper-tts 1.8.0, Ollama 0.40.17 and the llama3.2:3b model, all checked on 21 November 2026. If you have not chosen a Whisper runtime yet, Whisper vs faster-whisper vs whisper.cpp compares the three; this page is the hands-on build with faster-whisper.
The two halves of the job
Speech-to-text and summarising are different problems, and keeping them in separate scripts makes each one checkable.
| Stage | Tool | What can go wrong | How you check it |
|---|---|---|---|
| Transcribe | faster-whisper, small model |
Misheard names and jargon, words merged across sentences | Read the transcript against the audio |
| Summarise | llama3.2:3b in Ollama |
Invented or misattributed items, wrong owner | Every item carries a timestamp you can look up |
The transcript is the source of truth. The summary is a draft that points back to it.
1. Set up the project
Create a folder and a virtual environment, then install pinned versions:
mkdir whisper-notes && cd whisper-notes
python3 -m venv .venv
source .venv/bin/activate
pip install faster-whisper==1.2.1 av==18.1.1 piper-tts==1.8.0
faster-whisper runs OpenAI’s Whisper models on CTranslate2 and decodes audio with PyAV, which bundles the FFmpeg libraries, so you do not need a separate ffmpeg install. The av pin is deliberate: with PyAV 19 (the version pip picked by default on the day), faster-whisper 1.2.1 failed on the first file with TypeError: open() got an unexpected keyword argument 'metadata_errors'. Pinning av==18.1.1 fixed it.
piper-tts is only there to make a test recording, so you can follow along without a microphone or someone else’s audio.
2. Make a test recording
Save this text as standup.txt. It is a short, made-up planning call with two decisions, two actions with owners and one open question:
Morning everyone, this is the Thursday planning call for the website relaunch.
First item, the launch date. We agreed last week to aim for the third of March, and nothing has changed, so the third of March stands.
Second item, the search page. Siobhan found that search is slow on mobile. She will profile it and report back by Tuesday.
Third item, the newsletter. We decided not to send a newsletter for the launch. We will announce it on the blog instead, and Tom will write that post by the end of next week.
Last item, the budget for user testing. That is still open. We need a quote from the agency before we can decide, and I will chase them tomorrow.
That's everything. Thanks all.
Download a voice and read the text aloud into a WAV file:
python -m piper.download_voices en_GB-alan-medium
python -m piper -m en_GB-alan-medium -f standup.wav --input-file standup.txt \
--noise-scale 0 --noise-w-scale 0
The result is about 45 seconds of speech. Piper adds a little random variation to each reading by default; setting both noise scales to 0 makes the file identical every time, so your transcript should match the one below. Because you wrote the script, you know exactly what a perfect transcript looks like, which is the point: you can measure the transcriber before you trust it on a real meeting. Swap in your own recording later; faster-whisper reads MP3, M4A, WAV and most other formats PyAV can decode.
3. Transcribe with timestamps
Save this as transcribe.py:
import sys
import time
from pathlib import Path
from faster_whisper import WhisperModel
def stamp(seconds: float) -> str:
minutes, secs = divmod(int(seconds), 60)
return f"{minutes:02d}:{secs:02d}"
# Names and jargon the model cannot guess. Edit for your recording.
VOCABULARY = ""
def transcribe(audio_path: str, model_size: str = "small") -> Path:
# int8 on CPU: about a quarter of the memory of float32, little loss in accuracy
model = WhisperModel(model_size, device="cpu", compute_type="int8")
started = time.perf_counter()
segments, info = model.transcribe(
audio_path,
language="en", # skip language detection when you know it
beam_size=5,
vad_filter=True, # drop silence before decoding
initial_prompt=VOCABULARY or None,
)
print(f"Audio: {info.duration:.1f}s, after VAD: {info.duration_after_vad:.1f}s")
out_path = Path(audio_path).with_suffix(".transcript.txt")
lines = []
# segments is a generator: transcription happens as you iterate
for seg in segments:
line = f"[{stamp(seg.start)}] {seg.text.strip()}"
print(line)
lines.append(line)
out_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
print(f"Wrote {out_path} in {time.perf_counter() - started:.1f}s")
return out_path
if __name__ == "__main__":
audio = sys.argv[1]
size = sys.argv[2] if len(sys.argv) > 2 else "small"
transcribe(audio, size)
Run it. The first run downloads the small model from Hugging Face (about 480 MB) into your cache; later runs start straight away.
python transcribe.py standup.wav
Audio: 44.9s, after VAD: 44.9s
[00:00] Morning everyone. This is the Thursday planning call for the website relaunch.
[00:04] First item, the launch date. We agreed last week to aim for the 3rd of March,
[00:10] and nothing has changed, so the 3rd of March stands.
[00:14] Second item, the search page. Given found that search is slow on mobile,
[00:19] she will profile it and report back by Tuesday.
[00:22] Third item, the newsletter. We decided not to send a newsletter for the launch.
[00:27] We will announce it on the blog instead, and Tom will write that post by the end of next week.
[00:33] Last item, the budget for user testing. That is still open.
[00:37] We need a quote from e-agency before we can decide, and I will chase them tomorrow.
[00:42] That's everything. Thanks all.
Wrote standup.transcript.txt in 7.9s
Three decisions in this script are worth understanding:
compute_type="int8"quantises the model’s weights to 8-bit integers. On a CPU this is the setting the faster-whisper README suggests, and it is what letssmalltranscribe 45 seconds of audio in about 8 seconds on a four-core machine.segmentsis a generator.model.transcribereturns at once, and the decoding happens inside theforloop. That is why the script can print lines as they arrive, and why forgetting to iterate means nothing is transcribed.vad_filter=Trueruns the Silero voice activity detector first and drops non-speech, which the README describes as conservative (it only removes silence longer than two seconds). Our clip has no long pauses, so the duration did not change; on a real meeting it saves time and stops Whisper inventing text in silence.
The timestamps come from each segment’s start. The summariser relies on them in step 5.
4. Fix the names Whisper cannot guess
Read the transcript against standup.txt. Most of it is right, with two errors. “Siobhan found” became “Given found”: Whisper has not been told about Siobhan, and the Irish spelling is nothing like the sound, so it picked the most likely English word. And “the agency” became “e-agency”. Names, product names and acronyms are the most common transcription errors in real meetings, and they are the words a summary most depends on.
The fix for names is to tell the model which words to expect. initial_prompt gives Whisper some text to treat as if it came just before the audio, which nudges it towards those spellings. Edit the vocabulary line in transcribe.py:
VOCABULARY = "Attendees: Siobhan, Tom."
Run it again:
python transcribe.py standup.wav
Audio: 44.9s, after VAD: 44.9s
[00:00] Morning everyone. This is the Thursday planning call for the website relaunch.
[00:04] First item, the launch date. We agreed last week to aim for the 3rd of March,
[00:10] and nothing has changed, so the 3rd of March stands.
[00:14] Second item, the search page. Siobhan found that search is slow on mobile. She will profile it
[00:20] and report back by Tuesday. Third item, the newsletter. We decided not to send a newsletter
[00:26] for the launch. We will announce it on the blog instead,
[00:29] and Tom will write that post by the end of next week. Last item, the budget for user testing.
[00:36] That is still open. We need a quote from e-agency before we can decide,
[00:40] and I will chase them tomorrow. That's everything. Thanks all.
Wrote standup.transcript.txt in 8.1s
Siobhan is spelled correctly now. Notice the segment boundaries moved too: the prompt changes what the model expects, so it changes how it splits the audio. faster-whisper also accepts hotwords="Siobhan Tom", which fixed the same name in our test; either works for a short list. Keep the vocabulary short and factual. A long prompt full of instructions is still treated as preceding speech, not as orders.
“e-agency” is still there. A vocabulary list cannot fix a common word misheard in a synthetic voice; a larger model or a cleaner recording might. Leave it in for now, because step 5 shows what happens to a transcription error downstream.
5. Summarise with a local model
Pull the model once (2.0 GB):
ollama pull llama3.2:3b
Save this as summarise.py. It uses only the Python standard library to call Ollama’s /api/chat endpoint:
import json
import sys
import urllib.request
from pathlib import Path
OLLAMA_URL = "http://localhost:11434/api/chat"
MODEL = "llama3.2:3b"
MAX_CHARS = 6000 # about 1,500 tokens of transcript per request
ITEM = {
"type": "object",
"properties": {
"text": {"type": "string"},
"timestamp": {"type": "string"},
},
"required": ["text", "timestamp"],
}
SCHEMA = {
"type": "object",
"properties": {
"decisions": {"type": "array", "items": ITEM},
"actions": {"type": "array", "items": ITEM},
"open_questions": {"type": "array", "items": ITEM},
},
"required": ["decisions", "actions", "open_questions"],
}
INSTRUCTIONS = """You extract notes from a meeting transcript.
Each transcript line starts with a [mm:ss] timestamp.
Return JSON matching this schema: {schema}
- decisions: things the group agreed or decided.
- actions: tasks with an owner and a due date if one was said, as "Owner: task (due)".
- open_questions: things explicitly left undecided.
For every item, set timestamp to the [mm:ss] of the line that supports it.
Only include what the transcript says. If a list has nothing, return []."""
def chunks(lines: list[str], max_chars: int) -> list[str]:
"""Split on line boundaries so no timestamp is cut in half."""
out, current = [], ""
for line in lines:
if current and len(current) + len(line) > max_chars:
out.append(current)
current = ""
current += line + "\n"
if current:
out.append(current)
return out
def extract(chunk: str) -> dict:
body = {
"model": MODEL,
"stream": False,
"format": SCHEMA,
"options": {"temperature": 0, "num_ctx": 8192},
"messages": [
{"role": "system", "content": INSTRUCTIONS.format(schema=json.dumps(SCHEMA))},
{"role": "user", "content": chunk},
],
}
req = urllib.request.Request(
OLLAMA_URL,
data=json.dumps(body).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req, timeout=600) as resp:
reply = json.load(resp)
return json.loads(reply["message"]["content"])
def summarise(transcript_path: str) -> None:
lines = Path(transcript_path).read_text(encoding="utf-8").splitlines()
known_stamps = {line[1:6] for line in lines if line.startswith("[")}
notes = {"decisions": [], "actions": [], "open_questions": []}
parts = chunks(lines, MAX_CHARS)
for i, part in enumerate(parts, 1):
print(f"Extracting from chunk {i} of {len(parts)}...", file=sys.stderr)
for key, items in extract(part).items():
notes[key].extend(items)
for key, title in [
("decisions", "Decisions"),
("actions", "Actions"),
("open_questions", "Open questions"),
]:
print(f"\n## {title}")
for item in notes[key]:
stamp = item["timestamp"].strip("[]")
flag = "" if stamp in known_stamps else " <-- timestamp not in transcript, check"
print(f"- {item['text']} [{stamp}]{flag}")
if __name__ == "__main__":
summarise(sys.argv[1])
Run it on the transcript from step 4:
python summarise.py standup.transcript.txt
Extracting from chunk 1 of 1...
## Decisions
- the 3rd of March stands [00:10]
- We decided not to send a newsletter for the launch [00:26]
## Actions
- Siobhan will profile the search page and report back by Tuesday [00:14]
- Tom will write the blog post by the end of next week [00:29]
- I will chase e-agency for a quote on user testing [00:40]
## Open questions
- the budget for user testing [00:36]
It took about 8 seconds on CPU once the model was loaded (the first call also loads it into memory). Your wording will differ; the structure should match. What each part of the script decides:
format: SCHEMAmakes Ollama constrain the reply to that JSON shape, sojson.loadsdoes not fail on a chatty preamble. Ollama’s structured outputs docs also suggest putting the schema in the prompt and setting temperature to 0, which the script does. Structured outputs covers the technique in depth.- A timestamp on every item turns the summary into something you can check. Each line points at the place in the transcript to read.
known_stampscatches the case where the model makes up a timestamp that does not exist. num_ctx: 8192sets the context window for this request. Ollama’s own default depends on your memory (4k tokens on machines with under 24 GiB of VRAM, per its docs), and a transcript that does not fit gets cut off without an error you will notice.
Now check the output against the transcript, as you would with any real summary. Both decisions and both named actions are right, and each timestamp leads to the supporting line. The third action shows two problems you will meet on real meetings. “e-agency” came straight from the transcript: the summariser cannot know the transcriber misheard, so a transcription error becomes a confident-looking action. And “I” is whoever was speaking; a single-speaker transcript cannot tell you who that was, so you fill in the name. This is why the transcript, not the summary, is the thing you check against.
6. Handle long recordings
An hour-long meeting gives a transcript of several thousand words, more than you want to send to a small local model in one request. chunks() splits the transcript on line boundaries into pieces of at most MAX_CHARS characters, summarise() extracts from each piece, and the lists are joined at the end. Because every line keeps its timestamp, items from later chunks still point at the right place.
The chunk size is a trade-off you can see on the test file. Set MAX_CHARS = 300 to force three chunks and run it again:
Extracting from chunk 1 of 3...
Extracting from chunk 2 of 3...
Extracting from chunk 3 of 3...
## Decisions
- The launch date is the 3rd of March [00:04]
- We decided not to send a newsletter for the launch. [00:26]
## Actions
- Siobhan will profile the search page and report back by Tuesday. [00:14]
- Owner: Tom, task (due) [00:29]
- Owner: (no owner), task (due) [00:36]
- Owner: (no owner), task (due) [00:40]
## Open questions
- Budget for user testing [00:36]
The timestamps still point at the right lines, but three actions have collapsed into the format template from the instructions, with no task in them. Each chunk only saw part of a topic, and with little to work on, a small model copied the example format instead of filling it. Use the largest chunk that fits comfortably in num_ctx, and when a topic spans a boundary, overlap chunks by a few lines and remove duplicates afterwards. Set MAX_CHARS back to 6000 before you move on.
To adapt the scripts to your own recordings, change three things: the VOCABULARY line for your names and terms, the model size in transcribe.py (try medium or large-v3 if small makes too many errors and you can wait longer), and the three lists in SCHEMA if you need something other than meeting notes, such as quotes for an interview or chapters for a lecture.
Pitfalls
Installing the latest PyAV. With av 19 and faster-whisper 1.2.1, the first call to transcribe fails with TypeError: open() got an unexpected keyword argument 'metadata_errors'. Pin av==18.1.1 alongside faster-whisper until a newer faster-whisper release supports it.
Calling transcribe and never iterating. segments is a generator, so segments, info = model.transcribe(...) alone does almost nothing. Loop over it or wrap it in list(); only then does decoding run.
Trusting names and terms in the transcript. Whisper writes plausible words for sounds it does not know, so “Siobhan” became “Given” and “the agency” became “e-agency”, and the summariser repeated the error. Put names and jargon in initial_prompt or hotwords, and read the transcript before you summarise it.
Leaving the context window at the default. A long transcript sent with Ollama’s default context can be silently truncated, and the summary then covers only part of the meeting. Set num_ctx, keep chunks well inside it, and check the summary mentions items from the end of the recording.
Treating “I” and “we” as owners. A transcript without speaker labels cannot say who “I” is. Fill in owners yourself, or start from a meeting tool’s transcript that has speaker names.
Chunks that are too small. Small chunks split a topic across requests, and a small model starts returning the format template instead of real items, as the three-chunk run showed. Use the biggest chunk your context allows.
Next steps
- Turn these notes into something attendees can check and correct with the meeting recordings to action items workflow.
- Compare runtimes before you transcribe hours of audio in Whisper vs faster-whisper vs whisper.cpp.
- Learn more about choosing and running a local model in Run local models with Ollama.
- Keep the Ollama commands cheat sheet open for pulling, listing and removing the summarising model.
- Make the JSON extraction sturdier with structured outputs.
- Follow the local models and fine-tuning learning path for what to build next on your own hardware.
- Move from recordings to live conversation with build a voice agent you can talk to.
Covers
- Tools
Check your understanding
Transcribe and summarise audio locally quiz
faster-whisper setup and pins, int8 on CPU, lazy segments, fixing misheard names, structured summaries with timestamps, context and chunking.
8 questions · pass mark 70%
Review
Related
- Whisper vs faster-whisper vs whisper.cpp for local transcription
Whisper vs faster-whisper vs whisper.cpp: three ways to run OpenAI's Whisper model on your own hardware, compared on speed, memory, platforms and setup.
- Run local models with Ollama
Install Ollama, run an open-weight model on your own machine, call it from scripts over the local API and choose a model size your hardware can handle, offline.
- Turn meeting recordings into decisions and actions
Turn a meeting recording into AI meeting notes listing decisions, owners and dates, each tied to a quote from the transcript so attendees can check every line.
- Get reliable JSON from an LLM with structured outputs
Describe the output as a schema, let the provider enforce it, validate it with Pydantic AI or the AI SDK, and handle failures.
- Speech-to-text (STT)
A model that converts spoken audio into written words, used for transcripts, captions, voice commands and meeting notes.