Skip to content

Instantly share code, notes, and snippets.

@NamesMT
Last active February 11, 2025 11:41
Show Gist options
  • Save NamesMT/9180bfe784c82326aa89603170212b03 to your computer and use it in GitHub Desktop.
Save NamesMT/9180bfe784c82326aa89603170212b03 to your computer and use it in GitHub Desktop.
Apollo/Sunshine steam streaming audio device enable/disable prep batch
@echo off
setlocal enabledelayedexpansion
REM Allow the script to load relative SoundVolumeView.exe
cd /D "%~dp0"
REM Check if an action argument is provided
if "%~1"=="" (
echo Usage: %0 [enable^|disable]
exit /b 1
)
REM Set the action based on the argument
if /i "%~1"=="enable" (
set "action=/Enable"
) else if /i "%~1"=="disable" (
set "action=/Disable"
) else (
echo Invalid action: %~1
echo Usage: %0 [enable^|disable]
exit /b 1
)
set "list[0]=Steam Streaming Speakers\Device\Speakers\Render"
set "list[1]=Steam Streaming Microphone\Device\Speakers\Render"
set "list[2]=Steam Streaming Microphone\Device\Microphone\Capture"
set count=0
:loop
if defined list[%count%] (
REM Main logic block
echo Executing: SoundVolumeView.exe %action% "!list[%count%]!"
SoundVolumeView.exe %action% "!list[%count%]!"
echo ---
REM Looper
set /a count+=1
goto loop
)
endlocal
exit /b 0
@NamesMT
Copy link
Author

NamesMT commented Feb 11, 2025

Usage: create global prep commands for do and undo:

Do: steam-audio-manager.bat enable
Undo: steam-audio-manager.bat disable

Requires nirsoft's SoundVolumeView
Script and SoundVolumeView packaged: NamesMT/static/steam-audio-manager.zip

@NamesMT
Copy link
Author

NamesMT commented Feb 11, 2025

A bit overkill script but it was fun googling around XD, could've just done multiple lines of SoundVolumeView haha.

Also credit: ClassicOldSong/Apollo#346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment