/KWisper

A very simplistic macOS tray icon application that converts speech to text using OpenAI's Whisper API.

Primary LanguagePython

KWisper

A macOS tray icon application that converts speech to text using OpenAI's Whisper API.

Features

  • Double-press Option/Alt key to start recording (press once shortly, then press and hold on second press), release to stop
  • Automatic transcription using Whisper API
  • Automatic clipboard paste of transcribed text
  • System tray icon for easy access
  • Configurable Whisper model and language settings

Requirements

  • macOS
  • Python 3.8+
  • OpenAI API key set as environment variable OPENAI_API_KEY

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Create a config.yml file with your settings:
whisper:
  model: "whisper-1" # OpenAI Whisper model to use
  language: "en" # Language code for transcription
  prompt: "Not a native English speaker. Improve grammar where needed." # Optional prompt to guide transcription
clipboard:
  restore_previous: true # Whether to restore previous clipboard content after pasting transcription

Usage

  1. Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY='your-api-key'
  1. Run the application:
python kwisper.py
  1. To start recording:
    • Press the Option/Alt key once shortly
    • Press and hold the Option/Alt key again
    • Release the Option/Alt key to stop recording and transcribe