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
02Create virtual environment
Create an isolated Python environment to keep Whisper and its dependencies separate from your system Python.
python3 -m venv ~/whisper-env
03Activate virtual environment
Activate the environment to start using it. You'll see (whisper-env) in your terminal prompt.
source ~/whisper-env/bin/activate
04Install Whisper
Now install OpenAI's Whisper package inside your virtual environment.
pip install -U openai-whisper
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
Available Models
| Model | Size | Notes |
|---|---|---|
| tiny | ~75MB | Fastest, least accurate |
| base | ~140MB | Recommended |
| small | ~460MB | Better accuracy |
| medium | ~1.5GB | High accuracy |
| large | ~2.9GB | Best 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.
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 data7R3M0R.txt— Plain text transcription7R3M0R.srt— Subtitle format (optional)7R3M0R.vtt— WebVTT format (optional)
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