How kuberwastaken/megaphone works
Megaphone is a native, on-device macOS dictation app. The principal workflow is a user-triggered hold/toggle shortcut, live audio capture and streaming transcription, transcript cleanup, then insertion into the active app; dictionary learning, inline commands with app context, and run history extend that flow. The graph also preserves settings/setup, diagnostics, and updating. Relationship evidence is limited to the README and the supplied source excerpts/index; undocumented wiring is omitted.
Main entry points: App.swift App lifecycle · SpeechAnalyzerService.swift SpeechAnalyzer · HotkeyManager.swift Shortcut backend · SettingsView.swift Settings and setup
Components 22
App and interaction
- App lifecycle
Sources/App.swift - Settings and setup
Sources/SettingsView.swift - First-run setup
Sources/SetupView.swift - Active-app context
Sources/AppContextService.swift
Shortcut and capture
- Shortcut backend
Sources/HotkeyManager.swift - Shortcut matching
Sources/ShortcutCore/ShortcutMatcher.swift - Dictation session
Sources/ShortcutCore/DictationShortcutSessionController.swift - Audio recording
Sources/AudioRecorder.swift
Transcription and language
- SpeechAnalyzer
Sources/SpeechAnalyzerService.swift - Smart cleanup
Sources/AppleFoundationModelsPostProcessor.swift - Basic cleanup
Sources/TranscriptTidier.swift - Personal dictionary
Sources/DictionaryStore.swift - Wake phrase
Sources/WakePhraseMatcher.swift - Voice macros
Sources/TransformStore.swift
History and support
- Run history
Sources/PipelineHistoryStore.swift - History records
Sources/PipelineHistoryItem.swift - Pipeline diagnostics
Sources/PipelineDebugPanelView.swift - Test-case export
Sources/TestCaseExporter.swift - Update manager
Sources/UpdateManager.swift
Other components
- Mac user
- Active application
- Release service
Connections 26
- Mac user → Shortcut backend: triggers
- Shortcut backend → Shortcut matching: reduces input
Sources/HotkeyManager.swift - Shortcut backend → Dictation session: dispatches events
- Mac user → Audio recording: speaks
- Audio recording → SpeechAnalyzer: streams audio
- SpeechAnalyzer → Smart cleanup: provides transcript
- SpeechAnalyzer → Basic cleanup: fallback cleanup
- Smart cleanup → Active application: uses context
- Active-app context → Active application: reads context
- SpeechAnalyzer → Personal dictionary: uses vocabulary
- SpeechAnalyzer → Wake phrase: checks trigger
- SpeechAnalyzer → Voice macros: applies macros
- App lifecycle → Shortcut backend: configures
Sources/AppState.swift - App lifecycle → Audio recording: starts recording
Sources/AppState.swift - App lifecycle → SpeechAnalyzer: coordinates transcription
Sources/AppState.swift - App lifecycle → Smart cleanup: requests cleanup
Sources/AppState.swift - App lifecycle → Active-app context: captures context
- App lifecycle → Run history: stores run history
Sources/AppState.swift - Run history → History records: persists records
Sources/PipelineHistoryStore.swift - Settings and setup → Personal dictionary: configures
Sources/SettingsView.swift - Settings and setup → Update manager: checks updates
Sources/SettingsView.swift - First-run setup → App lifecycle: configures
Sources/SetupView.swift - Pipeline diagnostics → Test-case export: exports cases
Sources/PipelineDebugPanelView.swift - Pipeline diagnostics → History records: displays pipeline
Sources/PipelineDebugPanelView.swift - Update manager → Release service: checks releases
Sources/UpdateManager.swift - App lifecycle → Settings and setup: shows interface
Sources/App.swift