Warble

Architecture

How the pieces fit, for contributors and anyone forking Warble.

Warble is a Swift package with two targets: WarbleKit, the library with all the logic and UI, and warble, a thin executable for the CLI and app entry point.

hotkey ─▶ DictationController ─▶ AudioRecorder ─▶ ParakeetTranscriber
                 │                                       │
                 ▼                                       ▼
             AppState ◀──────── DictionaryEngine ◀── raw text
        ┌────────┼─────────┐
        ▼        ▼         ▼
  menu bar     pill     windows ─▶ HistoryStore, DictionaryStore, SettingsModel

Modules

AppDelegate.swift
DictationController.swift
ModelLoader.swift
HotkeyController.swift
SoundPlayer.swift
AudioRecorder.swift
ParakeetTranscriber.swift
TextInserter.swift
PieceResponsibility
AppDelegateWires everything together and walks launch: settings, permissions, model, hotkey.
DictationControllerKey down to typed text: record, transcribe, apply the dictionary, paste, save to history.
AppStateObservable single source of truth: dictation phase, model status, waveform levels.
AudioRecorderMicrophone via AVAudioEngine and system audio via ScreenCaptureKit, written as 16 kHz mono.
ParakeetTranscriberFluidAudio's AsrManager with Parakeet TDT v3, loaded once and shared.
TextInserterPastes through the clipboard and restores what was there before.
RecordingPillControllerA click-through NSPanel hosting the SwiftUI pill on every Space.
WindowCoordinatorMain and setup windows; shows a Dock icon only while one is open.

Design choices

  • One phase enum. DictationPhase drives the icon, the pill and the sidebar status, so they cannot disagree.
  • Plain files. History, dictionary and settings are JSON a user can read, back up or delete.
  • No silent data loss. A file that fails to decode is moved aside as *.corrupt-<time>.json before anything new is written.
  • Testable core. Dictionary matching, stats, audio levels and the phase machine are pure and covered by unit tests.

On this page