1
0
Fork 0
mirror of https://github.com/eXpl0it3r/WhisperSFML.git synced 2026-11-14 05:01:09 +00:00
Using OpenAI's Whisper via whisper.cpp with SFML
  • C++ 96.1%
  • CMake 3.9%
Find a file
2026-10-02 16:17:46 +02:00
.github/workflows Update the CI runners and harden the workflow 2026-10-01 23:10:56 +02:00
res Add basic whisper transcription 2023-01-24 00:56:12 +01:00
src Add live microphone transcription 2026-10-02 16:17:46 +02:00
.gitignore Add live microphone transcription 2026-10-02 16:17:46 +02:00
CMakeLists.txt Update GitHub Actions images 2025-12-02 15:06:23 +01:00
LICENSE.md Update links and year 2025-12-02 17:34:44 +01:00
README.md Add live microphone transcription 2026-10-02 16:17:46 +02:00

WhisperSFML

Like the name WhisperSFML combines the OpenAI Whisper via Whisper.cpp and SFML to demonstrate real-time audio transcription (Speak-To-Text) as well as translation.

How To Use

  • Get the WhisperSFML source code
  • Make sure CMake and a compiler is installed
  • Get one of model files in the ggml format
    • I recommend at least base or small
  • Replace the model filename in src/main.cpp
  • Build and run
    • I recommend to run it in release mode

Note that quantized models created with an old version of Whisper.cpp only produce garbage, so make sure to get a recent one.

Modes

WhisperSFML needs to be started from the directory containing the res folder and can be run in two ways.

Microphone

WhisperSFML

Without any arguments the default recording device is transcribed while you speak.

The white text is final, while the gray text is still being worked on and can change as more audio comes in. The text is finalized as soon as you make a short pause, and it's additionally printed to the console. The bar at the bottom shows the input level and turns green, when it's loud enough to count as speech. If it never turns green with your microphone, lower silenceThreshold in src/StreamTranscriber.hpp.

Sound File

WhisperSFML res/George_W_Bush_Columbia_FINAL.ogg

When a sound file is passed, it's played back and transcribed as a whole. Note that Whisper is usually quicker than the playback, so the text tends to run ahead of what you hear.

Screenshot of WhisperSFML in action

Resources

License

The code itself is is available under 2 licenses: Public Domain or MIT -- choose whichever you prefer, see also the license file.