Better-Whisper is a command-line interface tool that uses the Whisper speech recognition model, providing easy audio file conversion and transcription capabilities. It handles all media formats so you can transcribe any file without configuration.
0916.mp4
If you're on macOS, that's
brew tap akash-joshi/homebrew-akash-joshi
brew install better-whisper
I recommend starting with ggm-tiny.en
as your model: https://huggingface.co/ggerganov/whisper.cpp/tree/main
You can quickly run the Better-Whisper directly from the CLI:
better-whisper [whisper-cpp arguments] <input-file>
Or using the cloned repo with go run
:
go run main.go [whisper-cpp arguments] <input-file>
better-whisper -m ~/Documents/ggml-model-whisper-small.en.bin -t 4 -p 2 -ml 21 -sow -osrt
- Converts various audio formats to WAV for Whisper processing
- Executes Whisper transcription on audio files
- Handles both direct Whisper commands and audio file inputs
You need to have ffmpeg
and whisper-cpp
installed on your system. If you're installing via Brew, these dependencies are installed automatically.
Instant usage:
go run main.go [whisper-cpp arguments] <input-file>
Build the project:
go build -o better-whisper main.go
Run the CLI tool:
./better-whisper [whisper-cpp arguments] <input-file>
If the input file exists, it will be converted to WAV format (if necessary) before being passed to Whisper. If the input file doesn't exist, the command will be passed directly to Whisper.
- The tool checks if the provided file exists.
- If the file exists, it's converted to a 16kHz, mono, 16-bit PCM WAV file using FFmpeg.
- The Whisper model is then executed on the converted file.
- After transcription, the temporary WAV file is deleted.
Errors during file conversion or Whisper execution are printed to the console. The tool attempts to clean up temporary files even if errors occur during transcription.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.