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

Some common prerequisites are required before installation.

Prerequisites for Ubuntu:

sudo apt update && sudo apt install build-essential python3-dev libportaudio2 ffmpeg

Prerequisites for Fedora:

sudo dnf groupinstall "Development Tools" && sudo dnf install python3-devel alsa-lib-devel ffmpeg

Installation Command:

pip3 install whisptray

Or if you have a newer system that requires pipx to install Python applications:

pipx install whisptray

Usage

whisptray

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

If you have an older computer, try:

whisptray --model tiny

This and several other model options offer various performance vs. accurancy tradeoffs. The turbo model is the best quality, and is the default. Use the --help options for more details.

If whisptray fails to start with errors related to audio input (e.g., cannot find microphone, errors from sounddevice despite installing prerequisites), please double-check:

  • Your microphone is correctly connected and configured in your OS sound settings.
  • Your Python environment is correctly set up and sounddevice installed properly within it.

Advanced Usage

You can customize the behavior using command-line arguments. For example, to use a specific microphone (ID 2, found by running with --device list) and a different energy multiplier:

whisptray --device 2 --energy_multiplier 2.0

Available arguments:

  • --device DEVICE: Microphone name or ID to use (e.g., "pulse", "USB Microphone", or an integer ID like 1). Pass list to see available microphone IDs and names. If omitted, the system default microphone is used.
  • --model MODEL: Whisper model to use. (choices: "tiny", "base", "small", "medium", "large", "turbo"; default: "turbo").
  • --max_key_rate COUNT: The maximum rate of generated keystrokes per second. Higher values are more responsive. Lower values give better compatibility with slow apps. (e.g. 1000 for native apps, 250 for glitchy web apps.)
  • --ambient_duration SECONDS: Duration (in seconds) to measure ambient noise before starting dictation. This helps set a baseline for voice activity detection. (default: 1.0)
  • --energy_multiplier MULTIPLIER: Multiplier applied to the measured ambient noise level to set the energy threshold for voice activity detection. Higher values are less sensitive. (default: 1.5)
  • -v, --verbose: Enable debug logging.
  • --version: Show program's version number and exit.
  • --help: Show the program's options and exit.

Troubleshooting

If the text appears garbled in some applications, trying specifying a slower key rate using the --max_key_rate command line argument.

Development

  1. Ensure thesystem prerequisites are installed as described in the Installation section.
  2. Clone this repository:
    git clone https://github.com/coder0xff/whisptray.git # Replace with your repo URL
    cd whisptray
    
  3. 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.3.1.tar.gz (63.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

whisptray-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl (499.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

whisptray-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

whisptray-0.3.1-cp311-cp311-manylinux_2_28_aarch64.whl (499.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

whisptray-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

whisptray-0.3.1-cp310-cp310-manylinux_2_28_aarch64.whl (499.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

whisptray-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

whisptray-0.3.1-cp39-cp39-manylinux_2_28_aarch64.whl (499.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

whisptray-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

whisptray-0.3.1-cp38-cp38-manylinux_2_28_aarch64.whl (499.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

whisptray-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: whisptray-0.3.1.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for whisptray-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6e93b0350cd7829abc5b28b816e3c0eed9cd5d816c426708519e5e713d7ec6b0
MD5 7225f2b08990bbb2bdbd4b56b4a0739a
BLAKE2b-256 24b6f49d192e32405705ca74e06788558a68088a86886d5deff468ada6afa903

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1.tar.gz:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bc4ff18c10575395f2baa7d17207c5806f539026118f7865590fafc14c9336ac
MD5 44cd3ec8ff92c6a389846f98794658fc
BLAKE2b-256 729468425f3548aec5fd30ceffa157923b342302d070e794ba6c06d2d1d4304e

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16e11bbe923779204666342899e579b8d6b05bed0336cae82c057dd98946f49c
MD5 d94c11961a40606e42bc87c8fd38898e
BLAKE2b-256 acb4f79021378e01a72ade0a9f250ac494322e20538fc342f0aca0cb204edc63

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f59e37f3e1048da37d2626cb0176f9b6ea59d97a96b98b8a5916f9cb2b432acb
MD5 2b82265175c762dae611a21098e1666b
BLAKE2b-256 d11e7875c834f1381930adc37449509c0c3193c8493d403697a71831a20a4003

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c32baf5f5d7ec59b4322534906dd8c958485d26c1d48b7ab89f68877fc8884d
MD5 b50993f1bd4ac7b4fde1fb5065a2bf97
BLAKE2b-256 5629fd2573d31bb5e5d9b38e45458edc333a33f7a5b9b63fd6f4e6d8de535056

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8fe6d558e6485d4afbc88baab73e92ad3d1feb62a80ed6c4d18b839a6d74165c
MD5 c7177beeecb24f56bf7aa0c6800862d1
BLAKE2b-256 3810a5b0b9109d74e0c5be38c5bafa0ca2a4cfba5b0620fa439b5a1153e2fe1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca9761c5c26543df00aeccced6115170813ca9ae9b52328458bb99d513663b8d
MD5 7d9f234754e999bebbba0f8b9971bfa6
BLAKE2b-256 c117e2ba8ff63cfb0c2fdf625947c687e213eb81578aa118048fc25833b4d179

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6eabaa9580a2110ac2b8ce7c15871a0353248f39faaa35daffa97db53e2d5367
MD5 5401e32f5f73ef2714b39624190609b7
BLAKE2b-256 e6e29bbf54452c2c8702b81defeac83e82565525fddd6442844e43afc6e8c993

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp39-cp39-manylinux_2_28_aarch64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 953b374800084ddad06e086b8b3d4a6afb3b2919091229198397b26a7f9be820
MD5 8eb4cdc35edd7481d33a9d1ddce8218f
BLAKE2b-256 406735064f186fa0a77ca2c16a1c50e7f15895a8744f04a6f615ea6963586994

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7a8760ea482cff94b1b2eb01f661adf605974d4bcf51b4838872d32f137a0020
MD5 f2e339f081c85730056d890e8a19654f
BLAKE2b-256 2c252a086c966687ecf6814a1fcb17462d7cebb8b45415cc9caafdfe452071ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp38-cp38-manylinux_2_28_aarch64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whisptray-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 62ab7747379759eaded5aeed84d209d98e5006bf59046f502c94b5ccf3b861ca
MD5 c2a3e00c1c99aa9520f7f516bdcb6c86
BLAKE2b-256 7cf3b0a635531ddf6d7a7a02dcf81258aec25dc89399c1414f7aa3efca1c1c75

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-to-pypi.yml on coder0xff/whisptray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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