A GNU/Linux bash script that allows to transcribe system audio output via whisper.cpp and copy the result to clipboard.
- Configured whisper.cpp.
- Downloaded main model and voice activity detection model.
- xclip (on X11) or wl-clipboard (on Wayland) for clipboard copy.
- PipeWire audio subsystem for sound recording via pw-record.
- curl for making requests to whisper-server.
-
Copy the transcribe_audio_output script into a directory under PATH.
-
Change lang and dir parameters in the script to match your target language for transcribing (a two-letter ISO-639-1 format) and whisper.cpp directory location.
-
If models other than ggml-large-v3.bin and ggml-silero-v6.2.0.bin are supposed to be used, update model and vad parameters respectively.
-
Mark the script as executable via file manager or terminal (e.g.
chmod +x ./transcribe_audio_output). -
Assign a certain shortcut (e.g. Super+X) to transcribe audio with the script in your system settings or configuration. For example:
-
Optionally assign another shortcut (e.g. Shift+Super+X) to unload the whisper-server process from RAM, in your system settings or configuration. For example:
- Press the assigned shortcut for transcribing in order to start recording system audio.
- Play your audio.
- Press the shorcut again to stop the recording, get it transcribed and copy the transcription to clipboard.
- Paste the transcribed text where it's needed.
- [Optional] Press the shortcut for unloading the whisper-server process to save RAM when the transcribing session is over.
GNU/Linux bash-скрипт, який дозволяє транскрибувати системний аудіовихід за допомогою whisper.cpp та копіювати результат у буфер обміну.
- Налаштований whisper.cpp (приклад).
- Завантажена основна модель та модель виявлення голосової активності.
- xclip (на X11) чи wl-clipboard (на Wayland) для копіювання в буфер обміну.
- Аудіо підсистема PipeWire для запису звуку через pw-record.
- curl для надсилання запитів до whisper-server.
-
Скопіюйте скрипт transcribe_audio_output у директорію, що входить до PATH.
-
Змініть параметри lang і dir у скрипті відповідно до потрібної мови транскрибування (дволітерний формат ISO-639-1) та розташування каталогу whisper.cpp.
-
Якщо планується використання інших моделей, ніж ggml-large-v3.bin та ggml-silero-v6.2.0.bin, оновіть параметри model та vad відповідно.
-
Зробіть скрипт виконуваним через файловий менеджер або термінал (наприклад,
chmod +x ./transcribe_audio_output). -
Призначте певну комбінацію клавіш (наприклад, Super+X) для запуску транскрибування в налаштуваннях сабо конфігурації системи. Наприклад:
-
За бажанням призначте іншу комбінацію клавіш (наприклад, Shift+Super+X) для вивантаження процесу whisper-server з оперативної пам’яті у налаштуваннях або конфігурації системи. Наприклад:
- Натисніть призначену комбінацію клавіш для транскрибування, щоб почати запис системного аудіо.
- Запустіть відтворення аудіо.
- Натисніть комбінацію клавіш ще раз, щоб зупинити запис, отримати транскрипцію та скопіювати її в буфер обміну.
- Вставте транскрибований текст у потрібне місце.
- [Опціонально] Натисніть комбінацію клавіш для вивантаження процесу whisper-server, щоб звільнити оперативну пам’ять після завершення сесії транскрибування.