Go to file
CorVous 5db3b0f7b1 Previous behavior only slept when there was audio in the buffer.
This caused two issues, it meant that quarter of a second pauses interrupted each time step, making the phrase timeout slightly inaccurate
and most importantly, it meant that the infinite loop wasn't being slept whenever there wasn't data in the queue, which makes it keep running with no pause
2024-03-14 10:49:16 -07:00
demo.gif Make real time transcription demo with OpenAI Whisper. 2022-11-28 22:27:56 -08:00
README.md Make real time transcription demo with OpenAI Whisper. 2022-11-28 22:27:56 -08:00
requirements.txt Really make it real time with no disk IO needed. 2023-11-21 14:10:31 -08:00
transcribe_demo.py Previous behavior only slept when there was audio in the buffer. 2024-03-14 10:49:16 -07:00

Real Time Whisper Transcription

Demo gif

This is a demo of real time speech to text with OpenAI's Whisper model. It works by constantly recording audio in a thread and concatenating the raw bytes over multiple recordings.

To install dependencies simply run

pip install -r requirements.txt

in an environment of your choosing.

Whisper also requires the command-line tool ffmpeg to be installed on your system, which is available from most package managers:

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# on Arch Linux
sudo pacman -S ffmpeg

# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg

For more information on Whisper please see https://github.com/openai/whisper

The code in this repository is public domain.