| 1 | #!/usr/bin/env python3 |
| 2 | """Transcribe an audio file with MLX Whisper (large-v3-turbo) and print the text. |
| 3 | |
| 4 | Used by Clover Recorder's marker overlay for voice notes. Runs against the venv |
| 5 | created by setup-dictation.sh (~/.clover-whisper/.venv). |
| 6 | |
| 7 | python transcribe.py <audio-file> |
| 8 | """ |
| 9 | import sys |
| 10 | |
| 11 | import mlx_whisper |
| 12 | |
| 13 | if len(sys.argv) < 2: |
| 14 | sys.exit("usage: transcribe.py <audio-file>") |
| 15 | |
| 16 | result = mlx_whisper.transcribe( |
| 17 | sys.argv[1], |
| 18 | path_or_hf_repo="mlx-community/whisper-large-v3-turbo", |
| 19 | ) |
| 20 | print(result["text"].strip()) |