Skip to main content

Push-to-talk voice dictation for Linux using Whisper AI

Project description

Praating-AI

Push-to-talk voice dictation for Linux. Hold a button, speak, release — text appears at your cursor.

Built for use with Claude Code, terminals, text editors, and any application.

Installation

1. Install system dependencies

sudo apt install xdotool portaudio19-dev libasound2-dev

2. Install praating-ai

With GPU support (recommended):

pip install praating-ai[cuda]

CPU only:

pip install praating-ai

Or install from GitHub:

pip install git+https://github.com/silentFred/praating-ai.git

3. Run

praating

First run downloads the Whisper model (~3GB for large-v3). Subsequent starts are fast.

Note: For GPU acceleration, use the wrapper script which sets up CUDA library paths:

./run.sh

Usage

Hold your mouse button (default: button9) while speaking, release to transcribe.

Text is typed wherever your cursor is focused.

Configuration

Create ~/.config/praating-ai/config.yaml to customize:

# Input settings
mode: push_to_talk          # push_to_talk or continuous
mouse_button: button9       # button8, button9, left, right, middle
model_size: large-v3        # tiny, base, small, medium, large-v3
device: cuda                # cuda (GPU) or cpu
compute_type: float32       # float32, float16, int8

# Continuous mode settings (always listening, auto-detects speech)
silence_threshold: 0.01     # Audio level below this is silence (0.0-1.0)
silence_duration: 1.5       # Seconds of silence before processing

# Output behavior
add_trailing_space: true    # Add a space after transcribed text
add_newline: false          # Add a newline after transcribed text
press_enter: false          # Press Enter after transcribing (useful for chat apps)
capitalize_first: true      # Capitalize first letter of transcription

Modes

  • push_to_talk: Hold mouse button while speaking, release to transcribe
  • continuous: Always listening, automatically detects speech and transcribes when you pause

Finding your mouse button

python3 -c "from pynput import mouse
print('Click your button...')
with mouse.Listener(on_click=lambda x,y,b,p: print(b) or not p) as l: l.join()"

Requirements

  • Linux with X11 (uses xdotool for typing)
  • Python 3.8+
  • Microphone
  • NVIDIA GPU recommended (falls back to CPU)

How It Works

  1. Loads Whisper speech recognition model on startup
  2. Listens for mouse button press → starts recording (beep)
  3. On button release → stops recording (beep)
  4. Transcribes audio using faster-whisper
  5. Types the text at cursor position using xdotool

Troubleshooting

No GPU acceleration

Make sure CUDA libraries are loaded. Use ./run.sh or set LD_LIBRARY_PATH to include the nvidia cudnn/cublas lib directories.

Text not appearing

  • Ensure xdotool is installed: sudo apt install xdotool
  • Check you're using X11: echo $XDG_SESSION_TYPE
  • For Wayland, you'd need to use ydotool or wtype instead

Wrong mouse button

Use the detection snippet above to find your button, then update mouse_button in your config.

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

praating_ai-0.1.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

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

praating_ai-0.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file praating_ai-0.1.0.tar.gz.

File metadata

  • Download URL: praating_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for praating_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1f4c9ed900f3cfcb6efd05c890fc380a2c143ace19f17b97ea4a592cfa5f8a09
MD5 115452b69c00c9999446ce8e87e95bf1
BLAKE2b-256 5bb04be018fc6bdf8cac554089c356264447109e6587f9ce395ad892c2327571

See more details on using hashes here.

File details

Details for the file praating_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: praating_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for praating_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53e073dba49ab41a5d4921486dc506a54b4d4f1bab724479e637a8f1a00ab1b9
MD5 46d04567861ac0a5d8cb22a6be5c4f68
BLAKE2b-256 2f9c323dc56151a66d0a3361e4ca20e02107bb2d1e50f28bbdbc800157f5b053

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