Switch the Windows default audio output device by name.
Uses pycaw to enumerate active render devices and set the default output.
Recommended: install via wsl-sys-cli instead for WSL integration.
Install dependencies into Windows Python:
python.exe -m pip install -r requirements.txtInstall wsl-sys-cli
# Switch to a Windows audio device named "speakers"
sys switch speakers
# Switch to a Windows audio device named "headphones"
sys switch headphonespython.exe __main__.py --switch-audio-device speakers
python.exe __main__.py --switch-audio-device headphonesThis sub-project is Windows-only at runtime, but you can still develop it from WSL.
- The Windows runtime dependencies in
requirements.txtare guarded with environment markers, so in WSL they will be skipped. - For editor type-checking in WSL (Pylance/Pyright), the repo provides local stub packages under
mswin/typings/.
Recommended WSL setup:
# In your WSL virtualenv (or whatever Python you use for editing/tools)
python -m pip install -r requirements-wsl-dev.txtNotes:
- If Pylance still shows unresolved imports after pulling changes, reload the VS Code window or restart the Pylance language server.
- To actually run the switcher, install dependencies into Windows Python and execute via
python.exeas shown above.