Whispering fork
README.md
Whispering
Version 1.4.0
Real-time speech-to-text application with AI-powered translation, proofreading, voice commands, text-to-speech with voice cloning, and streaming audio playback.
Whispering combines faster-whisper for state-of-the-art speech recognition with modern AI models (Claude, GPT-4, Llama) to provide a powerful voice interface for your workflow.

Key Features
Transcription & Translation
- Real-time Transcription: Fast and accurate speech-to-text using Whisper models.
- File Transcription: Transcribe audio files (MP3, WAV, FLAC, M4A, OGG) with time range selection.
- Live Translation: Translate speech to 100+ languages instantly.
- Auto-Type: Dictate directly into any application (Word, Browser, IDE, Discord).
- Smart Formatting: Paragraph detection and automatic punctuation.
Voice Commands
- Punctuation by Voice: Say “comma”, “period”, “question mark” to insert punctuation.
- Text Structure: “New paragraph”, “new line”, “tab” for document formatting.
- Multi-language Commands: Speak commands in English, Hebrew, French, German, or Spanish.
- Isolation Detection: Commands are only triggered when spoken as standalone phrases (not mid-sentence).
- Rich Text Output: Output panels render HTML for formatted text display.
AI Powers
- Intelligent Proofreading: Correct grammar and polish your spoken text.
- Context-Aware Translation: Nuanced translations that understand context.
- Custom Personas: Create specific AI assistants (e.g., “Summarize this”, “Start a Story”, “Q&A Mode”).
- Multi-Model Support: Use Claude 3.5, GPT-4, Gemini, or Llama via OpenRouter.
Text-to-Speech (TTS)
- Three TTS Backends: Choose between Chatterbox, Qwen3-TTS, or Kokoro depending on your needs.
- Streaming Playback: Audio plays chunk-by-chunk as synthesis completes, no waiting for the full text.
- Voice Cloning: Upload a 5-second audio sample to clone any voice (Chatterbox, Qwen3-TTS).
- 54 Built-in Voices: Kokoro ships with 54 voices across 9 languages.
- Read Aloud: Listen to your transcripts or AI responses from any output panel.
- Save Audio: Export generated speech to WAV/OGG files.
- Robust Text Handling: Markdown, numbered lists, and bullet points are automatically converted to natural prose for clean synthesis.
Session Management
- Automatic Logging: Secure JSONL logging of all sessions.
- Crash Recovery: Never lose a transcript, even if the app closes unexpectedly.
- History: Review past sessions organized by date.
TTS Backends
Chatterbox (ResembleAI)
High-quality voice synthesis with voice cloning support.
- Best for: Natural-sounding English speech with cloned voices.
- Voice Cloning: Yes (upload a reference audio file).
- Languages: English (standard), multilingual (optional model).
- GPU: NVIDIA GPU recommended. Auto-recovers from cuDNN errors with a 3-step fallback (CUDA, CUDA without cuDNN, CPU).
Qwen3-TTS (Alibaba)
Multilingual, multi-voice synthesis with preset speakers.
- Best for: Multilingual content across 10 languages.
- Voice Cloning: Yes (uses a separate Base model).
- Languages: English, Chinese, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian.
- Speakers: Ryan, Aiden, Vivian, Serena, Uncle_Fu, Dylan, Eric, Ono_Anna, Sohee.
- Model Sizes: 0.6B and 1.7B (configurable).
- GPU: Requires Flash Attention 2 and NVIDIA GPU for CUDA acceleration.
Kokoro (Lightweight, 82M)
Fast, lightweight synthesis with a large voice library.
- Best for: Quick responses and low-resource environments.
- Voice Cloning: No.
- Languages: 9 languages via voice prefix (American English, British English, Japanese, Chinese, and more).
- Voices: 54 voices including
af_heart(best female),bf_emma(best British female),am_fenrir,bm_fable, and many more. - GPU: Works on both CUDA and CPU.
- Text Sanitization: Automatically converts lists, bullets, colons, and markdown into natural prose for clean G2P processing.
Quick Start
Installation
git clone https://github.com/Jemtaly/Whispering.git
cd Whispering
./scripts/install.sh
The installer automatically detects your GPU, installs cuDNN libraries matching your PyTorch build, and sets up all three TTS backends. Each backend is independently optional.
Running the App
GUI (Recommended) A responsive, dark-themed web interface built with NiceGUI.
./scripts/run.sh
# or: ./scripts/run_nicegui.sh
CLI (Terminal UI) Curses-based terminal interface with AI, voice commands, auto-stop, and session logging.
python src/tui.py --help
Interface Guide
The GUI is divided into a control sidebar and dynamic output panels (“Whisper”, “AI”, “Translation”).
- Microphone: Select your input device and monitor audio levels.
- Model Settings: Choose Whisper model size (Tiny to Large-v3) and device (CUDA/CPU).
- AI Processing:
- Enable to use LLMs for proofreading or custom tasks.
- Trigger Modes: “Time” (every X seconds), “Words” (every X words), or “Manual” (Click “Process Now”).
- Tasks: Select a persona like “Proofread”, “Simplify”, or custom ones defined in settings.
- Text-to-Speech:
- Backend: Choose Chatterbox, Qwen3-TTS, or Kokoro.
- Source: Speak from Raw Transcript (W), AI Output (A), or Translation (T).
- Voice: Upload a reference file to clone a voice (Chatterbox/Qwen3-TTS), or select a built-in voice (Kokoro).
- Streaming: Audio plays in real-time as each chunk finishes synthesis.
- Voice Commands:
- Enable via the “Voice Commands” checkbox in the sidebar.
- Speak command words as standalone phrases (pause before/after).
- Commands are replaced with their text equivalents (e.g., “comma” ->
,).
Configuration
AI Setup
To use AI features, you need an API key (OpenRouter recommended).
- Copy the example config:
cp config/.env.example .env - Edit
.envand add your key:OPENROUTER_API_KEY=sk-...
Custom Personas
Define your own AI assistants in config/custom_personas.yaml:
summarizer:
name: "Summarizer"
prompt: "Summarize the following text into bullet points:"
Voice Commands
Voice commands are defined in config/voice_commands.yaml. The default configuration includes:
Supported Commands:
| Voice Command | Inserts | Variants |
|—————|———|———-|
| “comma” | , | virgule, komma, coma |
| “period” / “full stop” | . | punkt, punto |
| “question mark” | ? | fragezeichen |
| “exclamation mark” | ! | ausrufezeichen |
| “new paragraph” | \n\n | nuevo parrafo |
| “new line” | \n | nouvelle ligne |
| “colon” / “semicolon” | : / ; | doppelpunkt |
| “dash” / “ellipsis” | ` – ` / ... | tiret |
| “open quote” / “close quote” | " | |
| “open paren” / “close paren” | ` ( / ) ` | |
| “tab” | \t | indent |
Detection Modes:
isolation(default): Command must be the entire spoken segment. “I need a comma here” won’t trigger, but saying just “comma” will.prefix: Command must start with a wake word (e.g., “command comma”).
Adding Custom Commands:
commands:
my_signature:
action: insert_text
insert: "\n\nBest regards,\nJohn Doe"
triggers:
en: ["sign off", "my signature"]
File Structure
Whispering/
├── config/
│ ├── ai_config.yaml # AI model settings & prompts
│ ├── custom_personas.yaml # Custom AI assistants
│ └── voice_commands.yaml # Voice command definitions
├── logs/ # Session logs organized by date
├── scripts/ # Install & Run scripts
├── src/
│ ├── whispering_ui/ # NiceGUI Application (GUI)
│ │ ├── components/ # UI Widgets (Sidebar, Output, Help)
│ │ ├── bridge.py # UI <-> Core Logic Bridge
│ │ └── main.py # App Entry Point
│ ├── tui.py # Terminal User Interface (CLI)
│ ├── core_parts/ # Audio Device & Signal Processing
│ ├── ai_provider.py # OpenRouter AI Integration
│ ├── commands_config.py # Voice commands YAML loader
│ ├── command_detector.py # Voice command pattern matching
│ ├── command_executor.py # Voice command action dispatcher
│ ├── session_logger.py # JSONL Logging & Recovery System
│ ├── tts_provider.py # TTS backends (Chatterbox, Qwen3, Kokoro)
│ └── tts_controller.py # Chunking, playback queue, voice management
├── tts_output/ # Generated Audio Files
└── tts_voices/ # Uploaded Voice Reference Files
Requirements
System Requirements
- OS: Linux (PipeWire/PulseAudio), Windows 10/11, or macOS.
- Python: 3.10 or higher.
- GPU: NVIDIA GPU with CUDA 12 recommended for real-time performance.
- espeak-ng: Required for Kokoro TTS phonemization (installed automatically on most distros).
Python Dependencies
The core dependencies are installed automatically by install.sh, but include:
faster-whisper: Speech recognition engine.nicegui: Modern web-based UI framework.sounddevice: Low-level audio input and TTS playback.pydub: MP3 and other audio format support.pywebview&PyQt6: For running as a native desktop window.pyautogui: For the Auto-Type feature.chatterbox-tts: Chatterbox voice synthesis and cloning.qwen-tts+flash-attn: Qwen3 multilingual TTS.kokoro+misaki: Kokoro lightweight TTS with G2P.
Capturing System Audio
To capture speaker/system audio output on Linux with PipeWire:
Option 1: pw-loopback (Recommended)
# Run before starting Whispering:
pw-loopback --capture-props='media.class=Audio/Sink' --playback-props='media.class=Audio/Source'
Then select “pipewire” as your input device in Whispering.
Option 2: pavucontrol
- Start Whispering and begin recording with “pipewire” selected
- Open
pavucontrol-> Recording tab - Change Whispering’s input to “Monitor of [your speakers]”
Option 3: qpwgraph
Use qpwgraph for visual JACK-style audio routing.
Changelog
Version 1.4.0
New Features:
- Three TTS Backends: Added Qwen3-TTS and Kokoro alongside existing Chatterbox
- Qwen3-TTS: Multilingual synthesis (10 languages), 9 preset speakers, voice cloning via separate Base model, Flash Attention 2 acceleration
- Kokoro: Lightweight 82M model, 54 built-in voices across 9 languages, fast inference on both CUDA and CPU
- Streaming Audio Playback: TTS audio now plays chunk-by-chunk as each segment finishes synthesis instead of waiting for the full text
- Playback Queue: Text from the output panels accumulates in a queue with a 5-second timeout, then synthesizes and streams in real-time
- Timestamped TTS Logging: All TTS operations log with wall-clock time and delta timestamps (
[TTS HH:MM:SS.mmm +0.0s]) for performance tracking
Improvements:
- Intelligent text sanitization converts numbered lists, bullet points, colons, and markdown into natural prose before synthesis
- Per-sentence error recovery: if the G2P fails on one sentence, it retries as smaller fragments instead of skipping entirely
- cuDNN sublibrary preloading prevents version mismatch errors on systems with multiple CUDA installations
- Chatterbox auto-recovers from cuDNN errors with a 3-step fallback (CUDA -> CUDA without cuDNN -> CPU)
- Qwen3-TTS dynamic token limit calculation prevents audio truncation on longer texts
- espeak-ng library auto-detection across distros (Arch, Ubuntu, Fedora) for Kokoro phonemization
- Install script uses pre-built Flash Attention wheels when available, falling back to source compilation
Bug Fixes:
- Fixed Qwen3-TTS
torch_dtypedeprecation warning (now usesdtype) - Fixed Qwen3-TTS generation hanging on certain inputs
- Fixed Chatterbox SDPA attention incompatibility (forced eager attention)
- Fixed Kokoro G2P crash on numbered lists, bare proper nouns, and colon-terminated sentences
- Fixed choppy TTS playback by switching to chunk-by-chunk streaming
Version 1.3.0
New Features:
- Voice Commands (Phase 1): Control transcription with your voice
- Punctuation: “comma”, “period”, “question mark”, “exclamation mark”, etc.
- Structure: “new line”, “new paragraph”, “tab”
- Quotes & Parens: “open quote”, “close quote”, “open paren”, “close paren”
- Multi-language triggers: Commands work in English, Hebrew, French, German, Spanish
- Configurable via
config/voice_commands.yaml
- Rich Text Output Panels: Output panels now render HTML instead of plain text
Improvements:
- Native clipboard operations (xclip/xsel/wl-copy) replace JavaScript clipboard API for PyQt6 compatibility
- Command word suppression prevents “comma” from flickering in preview before replacement
- Isolation heuristic: Commands only trigger when spoken as standalone phrases
Version 1.2.3
New Features:
- File Transcription: Transcribe audio files (MP3, WAV, FLAC, OGG, M4A, etc.)
- Single file, multiple files, or entire directory selection
- Native file dialog using PyQt6
- Time range selection (start/end time) for partial transcription
- Audio playback with play/pause toggle and position scrubbing
- Periodic auto-save during long file transcriptions
- Crash recovery support for file transcription sessions
- AI/TTS Status Indicators: Visual indicators on the main panel showing when AI or TTS are enabled
- MP3/M4A Support: Added pydub fallback for audio formats not supported by libsndfile
Improvements:
- Play button now toggles play/pause and updates playback position
- File transcription uses dedicated queue to prevent result merging
- Better error handling for unsupported audio formats
Version 1.2
Improvements:
- Text output now persists when recording stops (clears only when new transcription starts)
- Crash recovery properly restores text into the UI window
- Thread-safe clipboard operations prevent crashes during active transcription
- Clean shutdown handling (Ctrl+C exits gracefully)
- Simplified audio device selection
Bug Fixes:
- Fixed copy/cut crash when used during active transcription
- Fixed log recovery not displaying recovered text in main window
License
MIT License
Commit history
- Merge pull request #18 from dovideh/claude/cleanup-old-gui-IyYU7
- Remove legacy tkinter GUI and align CLI with NiceGUI version
- Merge pull request #17 from dovideh/claude/add-tts-audio-playback-mgdNv
- docs: rewrite README for v1.4.0 with TTS backends and streaming playback
- fix: add terminal period after comma-joined list items
- fix: properly convert lists to comma-separated prose for Kokoro G2P
- fix: per-sentence error recovery and improved text sanitization for Kokoro
- fix: sanitize text before Kokoro TTS to prevent G2P crashes
- fix: always use --no-deps for kokoro to avoid numpy/spacy conflicts
- fix: resolve espeak-ng vs legacy espeak conflict for Kokoro TTS
- fix: robust kokoro install with fallback for spacy 4.x conflict
- fix: pre-install stable spacy before kokoro to avoid dev build failure
- feat: integrate Kokoro TTS as a third backend option
- Fix Qwen3-TTS torch_dtype deprecation and Flash Attention warnings
- fix: Qwen3-TTS dtype warning and hanging on generation
- feat: add timestamped TTS logging, unify terminal+GUI output, fix Qwen3 hang
- fix: use `dtype` instead of deprecated `torch_dtype` for Qwen3-TTS
- fix: stream TTS audio chunk-by-chunk to eliminate choppy playback
- fix: properly disable SDPA attention for Chatterbox TTS
- fix: accumulate all TTS text until stream ends before synthesizing
- fix: force eager attention for Chatterbox, add accumulation delay for TTS
- fix: preload cuDNN libs from pip package to prevent sublibrary mismatch
- fix: install cuDNN version matching PyTorch build to prevent mismatch
- fix: auto-recover from cuDNN errors in Chatterbox TTS
- fix: cuDNN error, FA2 dtype warning, choppy playback, stop behavior
- fix: make flash-attn required, install via pre-built wheels
- fix: allow Qwen3-TTS to work without flash-attn (eager attention fallback)
- fix: make flash-attn required for Qwen3-TTS, not optional
- fix: better TTS error handling when backends not installed
- fix: install.sh pip detection - use $PYTHON_CMD, handle active venvs
- feat: Add Qwen3-TTS backend, real-time audio playback, and improved install
- Merge pull request #16 from dovideh/claude/voice-commands-dual-model-3OcM7
- docs: Update README for v1.3.0 with voice commands documentation
- fix: Use native clipboard and suppress command word flickering
- fix: Add sanitize=False to ui.html() for NiceGUI compatibility
- feat: Implement Phase 1 voice commands with rich text output panels
- docs: Add voice commands dual-model feasibility analysis
- Merge pull request #15 from dovideh/claude/add-audio-transcription-6WDgb
- docs: Add Whispering interface GIF to README
- App ... Image
- docs: Update README for v1.2.3 with file transcription features
- fix: Reset file_transcription_mode when file transcription completes
- fix: Try soundfile first for all audio formats
- deps: Add pydub for MP3 audio format support
- fix: Add pydub fallback for MP3 and other audio formats
- fix: File transcription output and play/pause toggle
- fix: Use PyQt6 QFileDialog for native file selection
- fix: Use webview module directly for file dialog
- fix: Use pywebview native file dialog instead of tkinter
- fix: Use native file dialog instead of upload for file transcription
- feat: Add AI/TTS status indicators on main panel
- feat: Change AI & TTS panel to expand from left side
- refactor: Move AI & TTS settings into collapsible panel
- feat: Add time range selection, periodic saves, and crash recovery
- feat: Add audio file transcription feature
- Merge pull request #14 from dovideh/claude/speaker-monitor-capture-BaCQP
- docs: Update README for version 1.2
- fix: Remove JACK API enumeration to prevent memory corruption crash
- feat: Include JACK audio devices in mic dropdown
- refactor: Remove speaker monitor capture and channel selection features
- fix: Clean shutdown on Ctrl+C and add monitor device debugging
- feat: Show friendly names for speaker monitor devices
- fix: Allow monitor devices from PulseAudio/PipeWire host APIs
- fix: Add error handling for device selection and initialization
- feat: Add speaker monitor capture, fix text persistence, log recovery, and copy crash
- Merge pull request #13 from dovideh/feature/fix-log-duplication
- pyproject
- Merge pull request #12 from dovideh/feature/fix-translation-ai-conflict
- Merge pull request #11 from dovideh/claude/add-ai-qa-feature-01VJ1uRJ2XQ2xs7UNZeAbzU6
- minor update
- feat: add AI Q&A feature with TTS integration and audio playback controls
- Merge pull request #10 from dovideh/whispering_j4p8_work1
- fix: enforce full-height output panes and stabilize streaming text
- fix: stabilize whisper stream and lock AI/TTS controls
- fix: polish output layout and auto-stop handling
- Update README.md
- Merge pull request #9 from dovideh/claude/refactor-nicegui-modular-01BpvkETJg1HZwJ9FZt9SAcT
- feat: Add dark theme, compact layout, help system, and TTS file upload
- feat: Add all missing features from tkinter GUI to NiceGUI
- feat: Complete UI layout with proper element ordering
- fix: Reorder UI elements so sidebar can control output visibility
- feat: Implement dynamic show/hide for text panels
- fix: Use Queue wrapper for result queues to provide .put() method
- fix: Add QtPy for pywebview compatibility with PyQt6
- feat: Add native window mode detection and messaging
- feat: Enable native desktop window mode with PyQt6
- fix: Disable native mode, run in browser only
- fix: Convert relative imports to absolute imports
- fix: Add pywebview for native mode and avoid module loading warning
- fix: Rename ui package to whispering_ui to avoid NiceGUI conflict
- fix: Use correct NiceGUI shutdown handler API
- fix: Handle legacy autotype boolean setting in NiceGUI
- feat: Add launcher scripts for both UI versions
- feat: Refactor to modular NiceGUI architecture
- Merge pull request #8 from dovideh/claude/fix-translation-target-language-01DCfFCf8qRF8vok7V9dmLAw
- Remove md files
- docs: Add pull request description file
- docs: Update README with new configuration features
- feat: Add target language persistence and debug output control
- fix: Fix Translate Output unlock and status text overflow
Showing the most recent 100 of 180 commits.
Files
51 tracked files
at main.
config
- .env.example
- ai_config.yaml
- custom_personas.yaml.example
- voice_commands.yaml
docs
- voice-commands-feasibility.md
scripts
- debug_env.sh
- install.sh
- README.md
- run.sh
- run_nicegui.py
- run_nicegui.sh
- run_nicegui_direct.sh
src
core_parts
- __init__.py
- audio_devices.py
- paragraph_detector.py
- processing.py
whispering_ui
components
- __init__.py
- help.py
- output.py
- sidebar.py
- __init__.py
- bridge.py
- main.py
- README.md
- state.py
- ai_config.py
- ai_provider.py
- autotype.py
- cmque.py
- command_detector.py
- command_executor.py
- commands_config.py
- core.py
- debug.py
- debug_audio.py
- debug_cuda.py
- session_logger.py
- settings.py
- transcript_logger.py
- tts_controller.py
- tts_provider.py
- tui.py
- .gitignore
- AI_SETUP.md
- INSTALL_TTS.md
- LICENSE
- pyproject.toml
- README.md
- requirements.txt
- STRUCTURE.md
- Whispering.gif