---
title: "Transcribe speech and identify speakers with WhisperX"
description: "Transcribe speech with WhisperX in Python, identify speakers, and search the transcript with word-level timestamps."
url: "https://www.pixeltable.com/notebooks/whisperx-transcription"
updated: "2026-10-13"
---

# Transcribe speech and identify speakers with WhisperX

Transcribe speech with WhisperX in Python, identify speakers, and search the transcript with word-level timestamps.

- **Type:** Recipe
- **Group:** Audio

## How it works

You have recorded conversations and need a transcript with word timestamps and speaker labels. You want to find relevant speech and return to the point in the recording where it was said.

You use WhisperX to transcribe speech locally and align each word to a time and a speaker. pixeltable.functions.whisperx.transcribe() does that as a computed column on audio, or on audio taken from a video with extract_audio().

## What it covers

- Preview WhisperX transcription and save it for each clip
- Extract word timestamps and speaker labels
- Search speech segments with an embedding index

## What it uses

- **Install:** `pip install pixeltable 'whisperx>=3.8' sentence-transformers`
- **Environment variables it names:** `HF_TOKEN`
- **Pixeltable calls:** `whisperx.transcribe()`, `json.list_iterator()`, `pxt.create_table()`, `pxt.create_view()`, `insert()`, `add_computed_column()`, `add_embedding_index()`, `similarity()`

## A look at the code

```python
segments.add_embedding_index(
    'text',
    string_embed=sentence_transformer.using(model_id='all-MiniLM-L6-v2'),
)
```

## Open it

- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/audio/whisperx-transcription
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/audio/whisperx-transcription.mdx
