The Free Encyclopedia

Whisper with Timestamps

Generate audio timestamps for your readalong project. This walks through installing OpenAI's Whisper in an isolated environment on Ubuntu, running it against an MP3, and pulling out word-level timestamps as JSON.

01Install dependencies

First, we need to install Python virtual environment support and ffmpeg for audio processing.

sudo apt install python3-venv python3-full ffmpeg
NOTE What's happening? python3-venv — Allows you to create isolated Python environments. python3-full — Complete Python installation. ffmpeg — Essential for audio/video processing.

02Create virtual environment

Create an isolated Python environment to keep Whisper and its dependencies separate from your system Python.

python3 -m venv ~/whisper-env
NOTE Why use a virtual environment? Ubuntu 24.04 uses externally-managed Python environments. Virtual environments prevent conflicts between packages and keep your system clean.

03Activate virtual environment

Activate the environment to start using it. You'll see (whisper-env) in your terminal prompt.

source ~/whisper-env/bin/activate
WARNING You need to activate this environment every time you want to use Whisper in a new terminal session.

04Install Whisper

Now install OpenAI's Whisper package inside your virtual environment.

pip install -U openai-whisper
NOTE This will download Whisper and all its dependencies. The installation may take a few minutes depending on your internet connection.

05Run Whisper on your audio

Execute Whisper to generate timestamps from your MP3 file.

whisper /home/youruser/7R3M0R.mp3 --model base --output_format json --word_timestamps True --output_dir /home/youruser/whisper_output
NOTE Command breakdown. /home/youruser/7R3M0R.mp3 — Your audio file path. --model base — Which Whisper model to use. --output_format json — Export as JSON with timestamps. --word_timestamps True — Generate word-level timestamps. --output_dir — Where to save the results.

Available Models

ModelSizeNotes
tiny~75MBFastest, least accurate
base~140MBRecommended
small~460MBBetter accuracy
medium~1.5GBHigh accuracy
large~2.9GBBest accuracy

06Understanding Whisper output

During processing, Whisper will detect the language and show progress with timestamps. Here's what you'll see:

Detecting language using up to the first 30 seconds. Use `--language` to specify the language
Detected language: English
[00:00.000 --> 00:00.600]  Tremor.
[00:01.720 --> 00:08.660]  Above the smoldering ruins of Earth, hidden from the Sun's wrath, the USS drifted silently.
[00:09.520 --> 00:16.180]  It wasn't the old station. This was its successor, the United Space Station, commissioned
[00:16.180 --> 00:20.780]  by the US government and built by the one mind they feared yet still couldn't live without.
[00:21.660 --> 00:28.360]  Tremor. His triumph with truth.ai had sealed his legend, not just as a visionary,
[00:28.920 --> 00:33.440]  but as a ruthless, brilliant tech magnate. And he delivered.
NOTE Timestamp format explained. [00:00.000 --> 00:00.600] — Start time → End time (hours:minutes.milliseconds). Each line shows when that text segment begins and ends in your audio file.

07Retrieve your files

Once processing is complete, find your output files in the directory.

ls /home/youruser/whisper_output/

Whisper generates multiple output formats:

  • 7R3M0R.json — JSON with detailed timestamp data
  • 7R3M0R.txt — Plain text transcription
  • 7R3M0R.srt — Subtitle format (optional)
  • 7R3M0R.vtt — WebVTT format (optional)
NOTE View your JSON file:
cat /home/youruser/whisper_output/7R3M0R.json

The JSON file contains word-level timestamps perfect for creating your readalong!

Next Steps

Now that you have your timestamp file, you can:

  • Upload the JSON file along with your novel chapter text
  • Create an interactive readalong with synchronized highlighting
  • Build a custom web interface for your audiobook

Ready to build your readalong? Share your JSON file and chapter text!

Future Use

When you're done working with Whisper, deactivate the virtual environment:

deactivate

To use Whisper again in the future, just activate the environment:

source ~/whisper-env/bin/activate