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"). Non-English models are generally the base versions (e.g., "small" not "small.en"). "large" and "turbo" are multilingual by default.
  • --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 more detailed informational logging.
  • --version: Show program's version number and exit.
  • --help: Show the program's options and exit.

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.0.tar.gz (62.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.0-cp312-cp312-manylinux_2_28_aarch64.whl (498.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

whisptray-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

whisptray-0.3.0-cp311-cp311-manylinux_2_28_aarch64.whl (498.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

whisptray-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

whisptray-0.3.0-cp310-cp310-manylinux_2_28_aarch64.whl (498.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

whisptray-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

whisptray-0.3.0-cp39-cp39-manylinux_2_28_aarch64.whl (498.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

whisptray-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (480.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

whisptray-0.3.0-cp38-cp38-manylinux_2_28_aarch64.whl (498.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

whisptray-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: whisptray-0.3.0.tar.gz
  • Upload date:
  • Size: 62.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.0.tar.gz
Algorithm Hash digest
SHA256 d477c48e2bdf05098216eec9f97db2b0974c1d6527b9483ff54751ac5dd1a46b
MD5 b7944e10e3e8081a0ff7d9383e7a0f28
BLAKE2b-256 5d2a2032a00d5cd9808f6bde0bbeccdcf0d1fdee4b2edb5d290572be628bbc62

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0.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.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c46ec8fb7640ebb2b09af9d9f27bedfa2eabfbe1e5852b02949d3e67bd142772
MD5 993d59edc16587b1c6abb499f96c7d4c
BLAKE2b-256 0e8ed754f11df2f8270f905cf3bbbd2c8130877fc22633e67c70c61034c2117f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for whisptray-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 154b6cc57516cc675b2d98f84ac66729c83cec40f9149959fb4248a3b126623f
MD5 60739f54816a7794b74171dd2512f860
BLAKE2b-256 55bcdbd1057cd86f7373957e6bd0c7b93b67c271b16fb8dd3c653408b347382e

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4fe43859aebb85bb8e979bcc977ebd9822b9610cde5cc8451a7156e076831687
MD5 d695ae010794dc893e47b75eda3d8184
BLAKE2b-256 d20bbf0d88eba306081ca56a9a9e1c68515eff8ea7c4d92252da3c4bc6380205

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ac81479d75f7d973d7c5976b245eb8668ed4d50f3b8ac2aae4c753847697c95
MD5 84191d4d7cca49cb888129d997d36b19
BLAKE2b-256 a917e83721bff0567de5764462150bd82db4432ebef4e0b9e252bb565f72ab79

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 611904a2fe0a0fc090f727e91beb8346154dc0f97ff866792906e8f0640200ea
MD5 959000abd31cf234234b891d2f588aa6
BLAKE2b-256 ca4f97e910a23ce9bbb9986386b1fb908e58254cdd87b73f05f87115061899aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de7daf4e76b09cd91d232c04cc16195b52cf3f969c11c38fd85789f2f8dffb2e
MD5 94a087bf9725c64399f0909196ab7ccb
BLAKE2b-256 5264b7074a3939b175ab1c5e92abee176170fa1b42850368d6c1ecec71e91477

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6181e05470e701cc9a96ef1d364da222b8f782ab0fcb65617f09306543ee8a99
MD5 c1832813782bcdb91046db2623463692
BLAKE2b-256 dc932067dc32da3d50f89f0ef7c11843a97ceb17576032295f2c2a57b4420676

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9bb0b29cf70f22925e44425bb4e813577b287b2c674515bd33fdce3b9c2542a
MD5 e9067d0d9e55d1fdb3801230cd456019
BLAKE2b-256 75afe61ec7538e312ff7b92746605689950297d5f26f446813a1a392b722ba50

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2aae4a153c7e331b3430edff540304745d5e60080fc26fd015e4753376d72089
MD5 527654049181fe46feb2bb9b8e0fe488
BLAKE2b-256 641c1b411bfe6f24f4ab218a4f16acbf2a38d59d00558314c003b471c74ea9d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for whisptray-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 152f9791f5dac1a2a88dbeef5ac2b6d652959590a35f64c67d5c33305929dd1b
MD5 6cd2bffe7846b62aa92a681eb5441d25
BLAKE2b-256 6786fc6bc8766acf48c62a448f9f8e886545dec81697b244617d2c349b7aaee1

See more details on using hashes here.

Provenance

The following attestation bundles were made for whisptray-0.3.0-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