Documentation
¶
Overview ¶
app.go defines the Wails-bound Go App struct: the single object whose exported methods the WebView2 frontend calls as window.go.main.App.<Method>, and the source of the live events the frontend subscribes to via runtime.EventsOn.
This is the SKELETON phase: method bodies return zero/sample data and the event plumbing is stubbed. The signatures here are the contract everything else builds on — phase 2 wires these to the real engine/setup/config without changing a single signature. Only JSON-friendly types cross the boundary.
backend.go owns the REAL backend the Wails App binds to: the malgo duplex engine, the sound catalog, device enumeration, the VB-CABLE setup/routing controller, global hotkeys, and the persisted settings. It is the Wails counterpart of the bootstrap that the legacy Fyne main.go performs inline: the SAME internal/* packages, wired the SAME way (auto-engage routing before resolving the mic, capture the previous default mic, mix into CABLE Input, monitor on the real speakers, seed gains + processing from saved settings).
Nothing here changes internal/* behavior: it reuses the existing engine, catalog, setup, devices, hotkeys, and config APIs exactly as the Fyne build does. Only the OWNER of the wiring moves from main() into a Backend the App can reach from its bound methods.
Command soundboard (Wails v2 build — the DEFAULT/shipping entrypoint).
This is the SoundBoard GUI rebuilt on Wails v2 (Go + WebView2) with the new design. It is the sole entrypoint and default build; the legacy Fyne UI it replaced has been removed.
Architecture:
- The frontend (frontend/dist) is a vanilla HTML/CSS/JS shell reproducing the design comp; it is embedded into the binary via go:embed and served by the Wails asset server. No JS framework, no npm build step.
- The window is FRAMELESS (the design draws its own titlebar) and drags via the -webkit-app-region/--wails-draggable contract on the titlebar.
- The bound Go App (app.go) exposes the method contract the frontend calls as window.go.main.App.<Method> and emits live events the frontend subscribes to (gateLevel / routingStatus / installProgress).
- A companion system tray (getlantern/systray, systray.go) runs on its own goroutine alongside the Wails main loop: icon + Open/Quit menu. Closing the window QUITS; the sidebar's Tray button hides to the tray instead, and tray Open reshows it. Every exit unwinds through the Wails shutdown cleanup, which restores the user's default microphone.
The bound App methods are wired to the real backend (internal/audio, internal/setup, internal/config, internal/catalog, internal/hotkeys) via the Backend constructed in main and injected with app.setBackend, without changing any bound-method signature from the original binding contract.
systray.go runs the companion system-tray icon + menu on its own goroutine, coexisting with the Wails main loop.
Why a companion tray: Wails v2 has no robust built-in native systray, so we run getlantern/systray (the same library Fyne's tray wraps) on a dedicated goroutine. systray.Run owns its own OS message loop and blocks, so it MUST run off the Wails main thread.
Coordination: the tray's menu items need the Wails runtime context to show the window / quit, but that context only exists after Wails' OnStartup. The tray therefore calls back into the App (app.ShowFromTray / app.Quit), which no-op safely until app.ctx is set. This keeps the two main loops decoupled.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
devcheck
command
Command devcheck is a headless diagnostic that initializes the real malgo (miniaudio) WASAPI context and enumerates the system's audio devices, then reports whether the VB-CABLE endpoints and a default microphone were found.
|
Command devcheck is a headless diagnostic that initializes the real malgo (miniaudio) WASAPI context and enumerates the system's audio devices, then reports whether the VB-CABLE endpoints and a default microphone were found. |
|
internal
|
|
|
apm
Package apm wraps the real WebRTC AudioProcessingModule (APM) and exposes a tiny Go surface — a single ProcessCapture call over one 480-sample mono frame — so the mic-path worker can match Discord's capture chain EXACTLY (high-pass filter, noise suppression, and automatic gain control) with the same DSP library Discord itself uses.
|
Package apm wraps the real WebRTC AudioProcessingModule (APM) and exposes a tiny Go surface — a single ProcessCapture call over one 480-sample mono frame — so the mic-path worker can match Discord's capture chain EXACTLY (high-pass filter, noise suppression, and automatic gain control) with the same DSP library Discord itself uses. |
|
audio
Package audio is the real-time engine: a malgo DUPLEX device that mixes the live mic with active clip cursors into the VB-CABLE input, plus an optional independent playback-only monitor device.
|
Package audio is the real-time engine: a malgo DUPLEX device that mixes the live mic with active clip cursors into the VB-CABLE input, plus an optional independent playback-only monitor device. |
|
catalog
Package catalog holds the sound-library domain model plus decode/cache.
|
Package catalog holds the sound-library domain model plus decode/cache. |
|
config
Package config persists user settings as JSON under os.UserConfigDir()/soundboard/config.json.
|
Package config persists user settings as JSON under os.UserConfigDir()/soundboard/config.json. |
|
denoise
Package denoise provides the mic-path noise suppressor for the audio suite, behind a small Denoiser interface so the rest of the engine never depends on whether RNNoise actually built.
|
Package denoise provides the mic-path noise suppressor for the audio suite, behind a small Denoiser interface so the rest of the engine never depends on whether RNNoise actually built. |
|
denoise/crnnoise
Package crnnoise is the cgo bridge to the vendored RNNoise C library (Xiph / Gregor Richards 2018 model, BSD-licensed — see LICENSE in this directory).
|
Package crnnoise is the cgo bridge to the vendored RNNoise C library (Xiph / Gregor Richards 2018 model, BSD-licensed — see LICENSE in this directory). |
|
devices
Package devices wraps malgo device enumeration and provides matching helpers for the VB-CABLE endpoints and the user's microphone.
|
Package devices wraps malgo device enumeration and provides matching helpers for the VB-CABLE endpoints and the user's microphone. |
|
hotkeys
Package hotkeys registers global system hotkeys via golang.design/x/hotkey (pure-Go user32 syscalls on Windows) and forwards triggered clip IDs.
|
Package hotkeys registers global system hotkeys via golang.design/x/hotkey (pure-Go user32 syscalls on Windows) and forwards triggered clip IDs. |
|
setup
Package setup owns the one-click VB-CABLE provisioning and the auto-route that makes Discord need ZERO configuration.
|
Package setup owns the one-click VB-CABLE provisioning and the auto-route that makes Discord need ZERO configuration. |
|
winaudio
Package winaudio controls the Windows default audio endpoints via the COM MMDevice API plus the undocumented IPolicyConfig interface.
|
Package winaudio controls the Windows default audio endpoints via the COM MMDevice API plus the undocumented IPolicyConfig interface. |
|
wizard
Package wizard provides first-run help: detecting the VB-CABLE endpoints and surfacing the download link plus the exact Discord configuration checklist.
|
Package wizard provides first-run help: detecting the VB-CABLE endpoints and surfacing the download link plus the exact Discord configuration checklist. |