Team Fortress 2

Team Fortress 2

Not enough ratings
TF2 Volume Monitor: Background Program Sets tf_win64.exe to 20% Volume on startup
By paint(surfsharkVPN
TF2 always started at 100% vol in Windows and the "Dong" sound when server found was very loud.
I made this Python script which stays in background to fix this.
   
Award
Favorite
Favorited
Unfavorite
What this Python Script Does
  1. Check if TF2 volume>=99
  2. Set its volume to 20%
  3. Continue to exist
  4. If you want to kill it, stop Python(32bit) in Task Manager.

updated 30-Apr
How to Use
  1. Install Python
  2. Save the following code as tf2_volume_monitor.pyw
  3. Double click to run
System Requirements
Code
tf2_volume_monitor.pyw
from pycaw.pycaw import AudioUtilities, ISimpleAudioVolume import psutil import time def get_tf2_volume(): sessions = AudioUtilities.GetAllSessions() for session in sessions: if session.Process and session.Process.name() == "tf_win64.exe": volume = session._ctl.QueryInterface(ISimpleAudioVolume) return volume return None def main(): while True: try: volume = get_tf2_volume() if volume: current_volume = volume.GetMasterVolume() # If volume is 100% (1.0), set it to 20% (0.2) if current_volume >= 0.99: volume.SetMasterVolume(0.2, None) time.sleep(1) except Exception: time.sleep(1) continue if __name__ == "__main__": main()

2 Comments
Supine 💖 59 30 Apr @ 10:14am 
Why? On KDE Linux Audio Volume is preserved. Also, you can change a game's volume in the console: `volume 0.2`
RayenIDK 30 Apr @ 9:09am 
cant i just do it manually once and forget about it, whats the point of this script? :steamfacepalm: