This is a quick experiment to achieve almost realtime transcription using Whisper.
Install the requirements:
pip install -r requirements.txt
Run the script:
python openai-whisper-realtime.py
Dependencies:
A very fast CPU or GPU is recommended.
The systems default audio input is captured with python, split into small chunks and is then fed to OpenAI's original transcription function. It tries (currently rather poorly) to detect word breaks and doesn't split the audio buffer in those cases. With how the model is designed, it doesn't make the most sense to do this, but i found it would be worth trying. It works acceptably well.