| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Switch your default audio output with a single key — and actually move every running app to the new device — then get a fast, slick AMD-style overlay telling you where the sound went. Built to be bound to a Stream Deck (or any hotkey), but works fine from the command line too.
Windows can change the default output, but it leaves apps that are already playing stuck on the old device. This tool fixes that: it flips the default and re-routes each running app in one go.
That's it. Tap a key — the sound switches and the overlay appears.
powershell -ExecutionPolicy Bypass -File .\audio-switch.ps1 1 # key 1
powershell -ExecutionPolicy Bypass -File .\audio-switch.ps1 2 # key 2
powershell -ExecutionPolicy Bypass -File .\audio-switch.ps1 list # show devices + active appsThe .vbs launchers run the same thing with no console window flashing, which is what you want for a Stream Deck button.
Settings live in audio-switch.config.json (created by the installer; see audio-switch.config.example.json for the shape). If the file is missing, the script falls back to built-in defaults.
| Field | Meaning |
|---|---|
| slots.<n>.label | Text shown in the overlay (displayed uppercase). |
| slots.<n>.icon | monitor, headset, or speaker. |
| slots.<n>.id | Exact device id (Command-Line Friendly ID). Used first — most reliable. |
| slots.<n>.fragment | Optional fuzzy fallback (a unique part of the device name). |
| slots.<n>.name | Device display name — fallback match and overlay subtitle source. |
| ui.corner | TopRight (default), TopLeft, BottomRight, BottomLeft. |
| ui.gapX / ui.gapY | Margins from the corner, in pixels. |
| ui.closeMs | How long the overlay window stays before closing (ms). |
Device matching tries id -> fragment -> name, so even if a device id changes after a reconnection, the name still resolves it.
Colours, speeds, and the hold duration are in the <Storyboard> inside the Show-Toast function in audio-switch.ps1. The reds are #FF564D (light), #ED1C24 (AMD red), #A10E13 (dark); the panel is the #202024->#141418 gradient. The ~1.25 s hold is the gap between the end of the "write" (~0.52 s) and the start of the exit bars (~1.77 s).
The actual switch is just a couple of svcl calls and is effectively instant. The device default is set first (one call), then running apps are moved, and only after that does the overlay (WPF) load — so audio never waits on the animation. Apps already on the target are skipped.
If a key press still feels slightly delayed, the cost is almost always PowerShell process startup, not this script. The launchers already use -NoProfile to minimise it. For truly instant switching you'd avoid spawning a process per press — e.g. keep a resident listener or trigger the switch from an always-running AutoHotkey script. The log (audio-switch.log) records elapsed milliseconds at each stage and a final SWITCH DONE in ...ms, so you can see exactly where the time goes.
svcl /SetDefault changes the default output, but Windows does not move streams that are already open — that's why apps stayed on the old device. The script enumerates every active audio stream (one /scomma call), sets the default, then calls svcl /SetAppDefault per process id for each app not already on the target. Everything moves together, then the overlay is drawn.
| Back | FazBrowse Home | New Git URL |