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 keyboard events per second. Higher values are more responsive. Lower values give better compatibility with slow apps. Robust apps can tolerate up to --max-key-rate 1000, while the glitchiest only work as low as --max-key-rate 50.
  • --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.2.tar.gz (63.7 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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (513.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

whisptray-0.3.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (500.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

whisptray-0.3.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (513.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

whisptray-0.3.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (500.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

whisptray-0.3.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (513.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

whisptray-0.3.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (500.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

whisptray-0.3.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (513.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

whisptray-0.3.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (500.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

whisptray-0.3.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (513.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

whisptray-0.3.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (500.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

File details

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

File metadata

  • Download URL: whisptray-0.3.2.tar.gz
  • Upload date:
  • Size: 63.7 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.2.tar.gz
Algorithm Hash digest
SHA256 0bed3c3a748fa363d99c0ea57e3df1d216cf7f69296f76a6f812248371547aa5
MD5 12ac1977010ad88e2ae3059eda2d0511
BLAKE2b-256 f695cee3776a4fcf3cc59b2c16179ecad7518c80488b637a3c4421b0bd10f9c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2.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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6740b100d19d3408cfbd527150bf6327566723f6d529b16510919e95845854c7
MD5 bf3d4eadb9478a452b169fe2996db9a1
BLAKE2b-256 257d00a4dff78b228244b064403c21ad4f0edc019de8fe90b5d4f9c75d0207fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_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.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6dd61d590149fda6c5e6fa9b7768c4aeed6a02aa496014769d1f3cecccdd0e02
MD5 2faaed6e2013ce939dabf4ab8870bdcc
BLAKE2b-256 0c0c6c5863e91276d162dbd7c1df9c4c622d354e08f3d406581fa8dfbd4a613a

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.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.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3dd7159ae4141fcada8a2345906dd63f89dc53eafcb32759fe8fb3d9af67dcf4
MD5 3fc059ba55785485b1c63ef505832d7e
BLAKE2b-256 6c7078666b3ed3bf18b25e49c301fd2d685bbc72af17751bfac1c66e79f344eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_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.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9ec804588c189a321e96c1e5ff10349d64a8b1e5d56fc8733f593ce26034e37b
MD5 03386c5d350e220c06d877b59d221900
BLAKE2b-256 797377a4e26a222d2e44b8382ce3af9c136f22894d17e6f127af0c163a41ef97

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.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.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38006aafa4a79f123c5790c50b257bd17ddbc96c50eda9bfc2f15b667e8279de
MD5 646e31bd9ecd88ed3c0c6c51be513be5
BLAKE2b-256 69bd2ba5b5c45dc30bc18103b1de04d71bc9762513312e48b2bdad53a1a496ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_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.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c6d03bd091043f4b8a18c74d42a7f8ad5e722c885df9f9b1912f654511b6521d
MD5 06dfcdd3ad095768264f53251e32649a
BLAKE2b-256 d62d17756a612fd877f4f7ae01edd422db26abc4916bed0747a3791b9baca5ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.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.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d88b6af5f6c33b0ef63b35fc8c8c28a541a82c16f12d415f34918936b62646ec
MD5 4e2045c8ce4fa0f91bc0a8effc378cb7
BLAKE2b-256 57f5e89e60e3e341f5b49dcb07943198d8aaf20c8801b93fdf679256325ed6f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_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.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 eb16c05594f0affe384e3475745b258c6631849d686ff73240e88afdde257d81
MD5 46ac142e442ca55ceeb61c6a59dc207b
BLAKE2b-256 c985f0778bdde23e5abfbfd4257abf8ce7c2d5329950924d9186e68f2249a135

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.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.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef6a6950e44067b2f1c0a7d54fd32c909ca3c5d680e4f84b28d231fd84630c72
MD5 b80f7e7dffbef7cbcbaff6ab83b77d8f
BLAKE2b-256 78001120c707154cb7db2266d596f4dd11f09577df6b73c5ff3acd219cceb51b

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_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.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d4123e2d82e5dfd49ae535764992e41a8412dd68a2d310646f8699e52a5f434e
MD5 9512fb94f05a5942ff045397b9ec5f39
BLAKE2b-256 ec5baff1bc034c96b35525359339bc4d1aedf6a39e084e138f7f8c67c2d8177a

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.2-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.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.

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