Skip to content

RooTooZ/shofar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Shofar Logo

Shofar

Cross-Platform Voice-to-Text

Speak naturally. Type instantly.

Go Version License Linux macOS Windows

Features β€’ Installation β€’ Usage β€’ Models β€’ Architecture


    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚       πŸŽ™ Recording...           β”‚
    β”‚    β–β–‚β–ƒβ–…β–†β–‡β–ˆβ–‡β–†β–…β–ƒβ–‚β–β–‚β–ƒβ–…β–†β–‡β–ˆβ–‡β–†β–…     β”‚
    β”‚            0:03                 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              ⬇️ Press hotkey
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  πŸ“ Result                      β”‚
    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
    β”‚  β”‚ Π’Π°Ρˆ распознанный тСкст    β”‚  β”‚
    β”‚  β”‚ появится здСсь            β”‚  β”‚
    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
    β”‚     [Π’ΡΡ‚Π°Π²ΠΈΡ‚ΡŒ]    [ΠšΠΎΠΏΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ]  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Press hotkey β†’ Speak β†’ Text appears in any application


πŸ’‘ Why Shofar?

Most voice input solutions are either cloud-based (privacy concerns), require complex setup, or don't integrate with the desktop. Shofar is different:

Problem Shofar Solution
πŸ” Privacy concerns 100% Offline β€” voice never leaves your machine
πŸ“¦ Complex dependencies Single Binary β€” no Python, Docker, or npm
πŸ–₯️ Limited integration System-wide β€” works in any app, any text field
⚑ Speed vs accuracy trade-off Hot-swap Models β€” switch engines on the fly

✨ Features

🎯 Core

  • Push-to-talk with customizable hotkey
  • Real-time waveform visualization
  • Auto-insert into active window
  • System tray with status indication

🧠 Engines

  • Whisper (OpenAI) β€” best accuracy
  • Vosk β€” fastest, lowest latency
  • LLM correction β€” fix recognition errors

🌍 Languages

  • πŸ‡·πŸ‡Ί Russian (primary)
  • πŸ‡¬πŸ‡§ English
  • πŸ”„ Auto-detection

🎨 Interface

  • Dark theme floating window
  • Editable results before insert
  • Copy to clipboard option
  • Desktop notifications

πŸ“¦ Installation

Quick Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/RooTooZ/shofar/master/install.sh | sh

Or download from Releases.


Build from Source

1. Install Dependencies

🐧 Arch Linux
sudo pacman -S portaudio libayatana-appindicator gtk3 pkg-config cmake xdotool

For Wayland:

sudo pacman -S wtype
🐧 Ubuntu / Debian
sudo apt install gcc pkg-config cmake xdotool \
    libportaudio2 portaudio19-dev \
    libayatana-appindicator3-dev libgtk-3-dev \
    libwayland-dev libx11-dev libx11-xcb-dev \
    libxkbcommon-x11-dev libgles2-mesa-dev \
    libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev

For Wayland:

sudo apt install wtype
🍎 macOS
brew install portaudio pkg-config cmake
πŸͺŸ Windows

Requires:

  • MinGW-w64 or MSYS2
  • CMake
  • PortAudio
# Using MSYS2
pacman -S mingw-w64-x86_64-portaudio mingw-w64-x86_64-cmake

2. Build

git clone https://github.com/RooTooZ/shofar.git
cd shofar

# Build everything (whisper.cpp + llama.cpp + binary)
make all

# Install to ~/.local/bin
make install

3. Download a Model

Models download automatically via Settings UI, or:

make download-model-tiny    # 75 MB  β€” fast
make download-model-small   # 466 MB β€” balanced
make download-model-turbo   # 574 MB β€” best quality

πŸš€ Usage

shofar    # or ./bin/shofar

Quick Start

Step Action
1 Press Ctrl+Shift+Space
2 πŸŽ™οΈ Speak while window is visible
3 Press hotkey again to stop
4 ✏️ Edit text if needed
5 Enter = insert, Esc = cancel

Keyboard Shortcuts

Key Action
Ctrl+Shift+Space Start / Stop recording
Enter Insert text into active window
Esc Cancel and close

Tray Menu

Right-click tray icon for:

  • βš™οΈ Settings β€” models, hotkey, language
  • πŸ”” Notifications β€” toggle on/off
  • ❌ Quit

🧠 Models

Speech Recognition

Engine Model Size Speed Accuracy Best For
Whisper tiny 75 MB ⚑⚑⚑ β˜…β˜…β˜†β˜† Quick commands
Whisper small 466 MB ⚑⚑ β˜…β˜…β˜…β˜† Daily use
Whisper turbo 574 MB ⚑ β˜…β˜…β˜…β˜… Documents
Vosk small-ru 45 MB ⚑⚑⚑⚑ β˜…β˜…β˜†β˜† Real-time

LLM Text Correction (Optional)

Model Size Description
Qwen2.5-1.5B 1.1 GB Fixes punctuation & typos

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           SHOFAR                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚   β”‚  Hotkey  β”‚ -> β”‚  Audio   β”‚ -> β”‚  Speech  β”‚ -> β”‚   Input  β”‚ β”‚
β”‚   β”‚  Handler β”‚    β”‚ Recorder β”‚    β”‚  Engine  β”‚    β”‚ Emulator β”‚ β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚        β”‚                              β”‚                         β”‚
β”‚        v                              v                         β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”‚
β”‚   β”‚   Tray   β”‚                  β”‚   LLM    β”‚                    β”‚
β”‚   β”‚   Icon   β”‚                  β”‚ Correctorβ”‚                    β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚                                                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  whisper.cpp  β”‚  llama.cpp  β”‚  vosk-api  β”‚  PortAudio  β”‚  Gio  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

shofar/
β”œβ”€β”€ cmd/shofar/            # Entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ app/               # Main coordinator
β”‚   β”œβ”€β”€ audio/             # PortAudio recording
β”‚   β”œβ”€β”€ speech/            # Engine factory (Whisper/Vosk)
β”‚   β”œβ”€β”€ llm/               # LLM text correction
β”‚   β”œβ”€β”€ hotkey/            # Global hotkey
β”‚   β”œβ”€β”€ tray/              # System tray
β”‚   β”œβ”€β”€ waveform/          # Recording UI
β”‚   β”œβ”€β”€ settings/          # Settings UI
β”‚   β”œβ”€β”€ input/             # xdotool/wtype wrapper
β”‚   └── i18n/              # Translations
└── third_party/           # whisper.cpp, llama.cpp, vosk

Tech Stack

Component Technology
Language Go 1.21+ (CGO)
Speech whisper.cpp, Vosk
LLM llama.cpp
Audio PortAudio
GUI Gio
Tray systray
Text Input xdotool (X11) / wtype (Wayland) / CGEventPost (macOS) / SendInput (Windows)

βš™οΈ Configuration

Config stored at ~/.local/bin/config.json:

{
  "model_id": "whisper-small",
  "language": "ru",
  "hotkey": { "key": "Space", "modifiers": ["Ctrl", "Shift"] },
  "llm_enabled": false,
  "notifications": true
}

πŸ›  Development

make whisper-lib    # Build whisper.cpp
make llama-lib      # Build llama.cpp
make build          # Build application
make run            # Run for testing
make clean          # Clean artifacts

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push branch (git push origin feature/amazing)
  5. Open Pull Request

πŸ“„ License

MIT License β€” use freely, attribution appreciated.


⬆ Back to top

Made with ❀️ for desktop users everywhere

Star ⭐ if you find it useful!

About

Voice to text cross platform app

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors