Skip to main content

A simple dictation program using Whisper, pynput, and pystray. After installing, run with 'whisptray'. A tray icon will appear in the system tray. Click it to toggle dictation. Double click to exit.

Project description

Whisptray

A simple dictation program that uses OpenAI's Whisper for speech-to-text, pynput for simulating keyboard input, and pystray for a system tray icon.

Features

  • Real-time dictation using Whisper.
  • Types recognized text into the currently active application.
  • System tray icon to toggle dictation and exit the application.
  • Configurable Whisper model and audio parameters via command-line arguments.

Installation And Use

pip install whisptray
whisptray

Click the tray icon to toggle dictation. Double click to exit.

You can customize the behavior using command-line arguments:

whisptray --model small --energy_threshold 1200

Available arguments:

  • --mic: Name of the microphone to use. Pass "list" to see available mics. (default: "default)
  • --model: Whisper model to use (choices: "tiny", "base", "small", "medium", "large", "turbo" - default: "turbo").
  • --non_english: Use the multilingual model variant (if applicable for the chosen size).
  • --energy_threshold: Energy level for mic to detect (default: 1000).
  • --record_timeout: How real-time the recording is in seconds (default: 2.0).
  • --phrase_timeout: Silence duration before a new phrase is considered (default: 3.0).
  • --default_microphone (Linux only): Name or part of the name of the microphone to use (default: 'pulse'). Use whisptray --default_microphone list to see available microphones.

Development

  1. Clone this repository:

    git clone https://github.com/coder0xff/whisptray.git # Replace with your repo URL
    cd whisptray
    
  2. Linux System Dependency (PortAudio for PyAudio): PyAudio is a dependency for microphone access and requires the PortAudio library. If installation in the previous step fails or PyAudio has issues, you may need to install the development headers.

    • Debian/Ubuntu-based systems:
      sudo apt-get update && sudo apt-get install portaudio19-dev
      
    • For other distributions, please consult their package manager for the appropriate PortAudio development package.
  3. System Dependency (ffmpeg for Whisper): Ensure ffmpeg is installed on your system, as Whisper requires it for audio processing.

    • Debian/Ubuntu-based systems: sudo apt update && sudo apt install ffmpeg
  4. make develop

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whisptray-0.2.0.tar.gz (30.0 kB view details)

Uploaded Source

File details

Details for the file whisptray-0.2.0.tar.gz.

File metadata

  • Download URL: whisptray-0.2.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.10

File hashes

Hashes for whisptray-0.2.0.tar.gz
Algorithm Hash digest
SHA256 731f11cc789a0c4a43b879a1393234eee5b479016b6248f32cd8c1a1bc284ed2
MD5 2c1b815cf6bc363b61ab7c93725ecd91
BLAKE2b-256 c99ddababcfcf061ffb4b0d12566fa9616f20c06d56eee61461d3369c56bd1b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page