Skip to content

batoucode/Superdictee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🎙️ SuperDictée — Dictée vocale IA locale

Fedora 44 / GNOME 50 / Wayland
Stack : faster-whisper + Ollama + GTK3 + AppIndicator3


Présentation

SuperDictée est une application de dictée vocale 100 % locale tournant en arrière-plan sous GNOME. Elle transcrit la voix via faster-whisper, corrige et traduit le texte via un modèle Ollama local, puis affiche une fenêtre de confirmation avant de coller le résultat dans n'importe quelle application.

Aucune donnée ne quitte la machine. Aucun abonnement cloud.


Fonctionnement

Double Ctrl (x2)
      ↓
AudioRecorder (GStreamer / PulseAudio)
      ↓
fichier WAV temporaire (16kHz, mono)
      ↓
faster-whisper  →  texte brut
      ↓
Ollama (qwen2.5:14b)  →  texte corrigé / traduit
      ↓
Fenêtre de confirmation (éditable)
      ↓
wl-copy  →  presse-papier Wayland
      ↓
ydotool  →  Ctrl+V automatique

Indicateurs visuels

État Icône tray Overlay
Veille 🔵 Bleue
Enregistrement 🔴 Rouge clignotante Fond rouge + ⏺
Traitement IA 🟠 Orange Fond orange + ⚙
Résultat 🔵 Bleue Fenêtre de confirmation

Installation

1. Dépendances système

sudo dnf install -y \
    python3-gobject \
    python3-gstreamer1 \
    gstreamer1-plugins-good \
    gstreamer1-plugins-bad-free \
    wl-clipboard \
    libnotify \
    libappindicator-gtk3 \
    mpg123 \
    ydotool

# Activer AppIndicator dans GNOME
gnome-extensions enable appindicatorsupport@rgcjonas.gmail.com

2. Dépendances Python

pip install --user faster-whisper evdev

3. Ollama

# Installer Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Télécharger un modèle (recommandé)
ollama pull qwen2.5:14b
# ou plus léger :
ollama pull qwen2.5:7b

4. Déployer l'application

mkdir -p ~/.local/share/voicedicto
cp superdictee.py ~/.local/share/voicedicto/main.py
chmod +x ~/.local/share/voicedicto/main.py

5. Service systemd utilisateur

mkdir -p ~/.config/systemd/user

cat > ~/.config/systemd/user/voicedicto.service << 'UNIT'
[Unit]
Description=VoiceDicto — Dictée vocale IA locale
After=graphical-session.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/TONUSER/.local/share/voicedicto/main.py
Restart=on-failure
RestartSec=3
Environment=DISPLAY=:0
Environment=WAYLAND_DISPLAY=wayland-0
Environment=XDG_RUNTIME_DIR=/run/user/1000

[Install]
WantedBy=default.target
UNIT

# Remplacer TONUSER par ton username
sed -i "s/TONUSER/$USER/" ~/.config/systemd/user/voicedicto.service

systemctl --user daemon-reload
systemctl --user enable --now voicedicto.service

6. Groupe input (pour le double Ctrl)

sudo usermod -aG input $USER
# Déconnexion/reconnexion de session requise

Raccourci clavier

Double appui sur Ctrl (gauche ou droite) dans une fenêtre de 400ms.

Le délai est configurable dans le menu tray → Paramètres.


Configuration

Fichier : ~/.config/voicedicto/config.json

{
  "ollama_model": "qwen2.5:14b",
  "ollama_url": "http://localhost:11434/api/generate",
  "ollama_prompt": "Tu es un assistant de correction. Traduis ce texte en français si nécessaire, corrige la ponctuation et l'orthographe. Réponds UNIQUEMENT avec le texte corrigé, sans explication.",
  "whisper_model": "base",
  "whisper_language": "fr",
  "sound_start": "",
  "sound_stop": "",
  "notify_on_copy": true,
  "double_ctrl_ms": 400
}

Accessible aussi via l'icône tray → Paramètres (interface graphique).


Modèles Whisper recommandés

Modèle VRAM Vitesse Qualité
tiny ~1 GB ⚡⚡⚡ ★★
base ~1 GB ⚡⚡ ★★★
small ~2 GB ★★★★
medium ~5 GB ★★★★★

RTX 3070 (8 GB VRAM) → small recommandé.


Sons d'alerte

.wav et .mp3 supportés. Configurer via le menu tray → Paramètres → Sons d'alerte.

Dépendances audio :

  • WAV → aplay (alsa-utils, présent par défaut)
  • MP3 → mpg123 ou ffplay

Commandes utiles

# Statut du service
systemctl --user status voicedicto

# Logs temps réel
journalctl --user -u voicedicto -f

# Redémarrer
systemctl --user restart voicedicto

# Désactiver
systemctl --user disable --now voicedicto

Dépannage

GStreamer ne trouve pas le micro

pactl list sources short

Ollama ne répond pas

systemctl status ollama
ollama run qwen2.5:14b "test"

faster-whisper ne détecte pas le GPU

pip install torch --index-url https://download.pytorch.org/whl/cu121

Double Ctrl ne fonctionne pas

groups $USER  # vérifier que 'input' est dans la liste

Licence

Projet personnel — DesCodes / batoucode
Usage libre pour usage personnel et professionnel.

About

Super Dicté - Application de dictée

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors