PatrikZero's CS:GO Hearing protection

Overview

PatrikZero's CS:GO Hearing protection

Program that lowers volume when you die and get flashed in CS:GO.
It aims to lower the chance of hearing damage by significantly reducing overall sound exposure.
Uses game state integration. Anti-cheat safe.

This will not get you VAC banned 100% as it does not hook into the game in any sort of way.

Usage

  • Download from releases on the right side ->

  • Chrome / Windows might flag it as a dangerous file because it doesn't know what it is but don't worry, as it is open source you can compile the code for yourself if you don't trust the .exe!

  • Put "gamestate_integration_VolumeFix.cfg" into your "Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg"

  • Run the .exe

    • You can also change how much the volume gets lowered by changing the decimal in "volume.txt"
  • To turn it off just right click the icon in the system tray and Quit.

How to autostart with Windows

This is really simple and recommended!

  • Place the main folder where you will not delete it (e.g. C:/)
  • Create a shortcut of the executable
  • Press Win + R
  • Type "shell:startup"
  • Place the shortcut in the "Startup" folder that opens up

How it works

Its simple, it lowers the volume when it detects a death and returns the volume when you get to freezetime. This effectively means your volume will be low for everything (e.g. Deathmatch) except actual matches (competitive / casual) where there is freezetime. It also mutes the game when you get flashed so you don't hear the horrible high pitched noise. (It only mutes it for the same duration as the game does so no disadvantage)

It is VAC safe because it uses game state integration and it only changes the Windows sound mixer settings for CS. So it doesn't touch the game at all. Game state integration is the same thing Steelseries for example uses for their mice to change color when you kill someone etc.

Reasonings

Players play CS with dangerously high peak volumes because they want to hear steps correctly. The risk of hearing damage can be severely reduced if you limit your exposure by lowering your volume when you die.

Even if you think your volume doesn't hurt you trust me it might over a long period of time. It took me 9 years of playing to develop tinnitus and I was playing at a reasonable volume. (Judged by multiple non-gamers and me)

I am no expert but I suspect this is due to a build up of small periods of very high volume (Shooting, Flashes, Grenades, Bomb explosion, Dinks).

When you spectate your teammates you get a multiple of the sound exposure you would normally get because on average you are going to have one duel and die, after that you don't need your full listening volume. My limited testing so far showed that lowering volume after death can lower exposure by 50% even if you live most of the round because most of the fighting and loud noises happen late round. (Pro play)

To be added

  • Flash volume reduction
  • Keyboard toggle to switch between High / Low volume
  • Dink (Helmet Headshot) volume reduction
  • Toggle for the app (On system tray)

How to build to .exe

  • pip install pyinstaller
  • pyinstaller --onefile --noconsole --icon Icon.ico --name "PatrikZeros CSGO Sound Fix" main.py

Sources

  • In sources.txt
  • Thanks to mdhedelund, Simon Brunning and Mark Hammond.
Comments
  • pycaw has a dependency of enum34 which pyinstaller reject

    pycaw has a dependency of enum34 which pyinstaller reject

    The 'enum34' package is an obsolete backport of a standard library package and is incompatible with PyInstaller
    

    @patrikzudel what version of python you are using? I am on windows with 3.7 and use pywin32 to install pycaw/pyinstaller since pyinstaller cannot cross-compile.

    I made some changes so my max volume is 0.2 while low volume is 0.0 but stuck due to this package enum34 not accepted by Pyinstaller.

    Can you let me know your python version and other dependencies? Are you using Python <3.4 for this?

    Thanks.

    opened by coralsundy 4
  • New feature needed

    New feature needed

    This program is excellent. Now I can play CSGO much more comfortably than before. I am a player from China. Many players here are also very interested in this project(avoid being deaf at Dust2 A long :) ). Many players also hope this program can reduce the sound of being headshot, which is also very loud. And another thing is that many people are still worried about being VAC although it has almost been proved VAC safe. I sincerely hope this project can be verified by Faceit and Valve as soon as possible. Very thankful for your work for the CSGO community!!!

    opened by Terman-thr 2
  • set autostart not possible

    set autostart not possible

    C:\Users\mO\Documents\PatriZero-CSGO-Hearing-Protection>"Start with windows.bat" Have you put the folder somewhere where you will not delete it (C:/ or Documents) (Y/[N])?Y C:\Users\mO\AppData\Local\Temp\24049-1466-13614-1174.vbs(6, 1) WshShortcut.Save: Die Verknüpfung "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PatrikZeros CSGO Sound Fix.lnk" wurde nicht gespeichert.

    opened by moxbo 2
  • I couldn't make it work

    I couldn't make it work

    I downloaded the .zip, extracted it and ran the .exe but nothing happened in game but the icon appeared in the tray.

    I'd be thankful if anybody can help

    opened by trautSS 2
  • csgo.exe volume level doesn't return after death

    csgo.exe volume level doesn't return after death

    The sound mutes after dying, but doesn't return to the level before. I'm not sure what debugging information I could provide.

    The readme says "returns volume when you get to freezetime", so I thought cl_disablefreezecam "1" was interfering with it, but setting it to 0 doesn't work either... so I'm not sure what "freezetime" is? I would absolutely love if it worked regardless of "freezetime" or not since I would love to have this feature everywhere (and I'm extremely excited about fixing the dink noise).

    I was only using this so far in "deathmatch" mode, and as far as I can guess (according to the wording), maybe the volume lowers upon dying and stays that way in a deathmatch, until the round pause timer (like pre-round stuff), then returns it?

    I suppose with that understanding, my issue is generally: I wish the getting hit/getting killed volume was lowered in general :(

    opened by mgavin 1
  • [BUG] Tray icon stuck sometimes after exit csgo

    [BUG] Tray icon stuck sometimes after exit csgo

    Hi @patrikzudel,

    The program sometimes stuck in tray after exiting csgo. Right click on the tray icon will not respond. Need to use task manager to end process.

    I havent dig into the code yet, but think it is something within this block: https://github.com/patrikzudel/PatrikZeros-CSGO-Sound-Fix/blob/main/main.py#L88-L98

    As of now I have no video recording yet. If I somehow get it happen again will see if I can record the issue.

    Thanks.

    opened by coralsundy 1
  • fixed typos, improved usage guide

    fixed typos, improved usage guide

    Just minor fixes. I found the usage guide a little confusing, might have gotten it wrong but from the code in volume.py the volume.txt decimal is the value the volume is set to not reduced by.

    great work btw :)

    opened by jannemannX 1
  • Volume is high initially, but then is lowered and stays lowered after first death

    Volume is high initially, but then is lowered and stays lowered after first death

    First, thanks for developing this tool!

    Description

    I have noticed that initially when joining a game, the volume has a level of (say) 100%. Then, after the first death (I think that's what triggers it), the volume is lowered and stays low. Is there a way to re-raise the volume after death?


    (Edited) From the README:

    Its simple, it lowers the csgo.exe volume when it detects a death and returns the volume when you get to freezetime. This effectively means your volume will be low for everything (e.g. Deathmatch) except actual matches (competitive / casual) where there is freezetime.

    Hmm, this could be the issue. I recall that I notice it mostly when playing DM, which means there is no freezetime. This could be the reason why the volume is never reset (raised) after the first death.

    Question: IIRC, GSI data (game state integration) exposes the type of the current match, i.e., whether it is DM, competitive, etc. This would allow putting in conditional code that (a) keeps the current behavior when playing competitive matches vs. (b) does not change the volume when playing DM?

    Here's an example snippet from the map provider of GSI, which includes the game mode. Example values for mode are:

    • "competitive"
    • "deathmatch"
    • "custom"
    • "casual"
    • "cooperative"
    • "scrimcomp2v2"
    • "skirmish"
    • "survival"
    • "training"
    {
        "map": {
            "mode": "competitive", // <-- this entry
            "name": "de_mirage",
            "phase": "live",
            "round": 0,
            "team_ct": {
                "score": 0,
                "consecutive_round_losses": 0,
                "timeouts_remaining": 1,
                "matches_won_this_series": 0
            },
            "team_t": {
                "score": 0,
                "consecutive_round_losses": 0,
                "timeouts_remaining": 1,
                "matches_won_this_series": 0
            },
            "num_matches_to_win_series": 0,
            "current_spectators": 0,
            "souvenirs_total": 0
        }
    }
    

    In the current gamestate_integration_VolumeFix.cfg, the map provider is disabled: https://github.com/patrikzudel/PatrikZeros-CSGO-Sound-Fix/blob/9da2a8ae7c1d9dbcd5a5eb16d1279a2965379faa/dist/gamestate_integration_VolumeFix.cfg#L19

    Enabling the map provider should have minimal impact because its data volume is small. Also, I can confirm that the data from the map provider is not restricted to spectators-only, i.e., it is actually available in any situation (i.e., when playing, when observing, etc.).

    Environment

    The software version is 1.1 as of Jan 2022. OS is Windows 11.

    My settings:

    • Death volume 40%
    • Flash volume 10%
    • Bomb explosion volume 20%

    Related Issues

    • This might be related to or the same issue as https://github.com/patrikzudel/PatrikZeros-CSGO-Sound-Fix/issues/15. The issue description sounds similar.
    opened by miguno 0
  • unhandled exception in script

    unhandled exception in script

    Traceback (most recent call last): File "main.py", line 5, in File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "gamestate.py", line 3, in File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "volume.py", line 6, in UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 157: illegal multibyte sequence

    opened by 2832167832 0
  • unhandled exception in script

    unhandled exception in script

    Traceback (most recent call last): File "main.py", line 5, in File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "gamestate.py", line 3, in File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "volume.py", line 6, in UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 157: illegal multibyte sequence

    opened by 2832167832 0
  • Modified version that works with Linux mint

    Modified version that works with Linux mint

    This version is a super-fast coded version that is tested and working with linux mint. Should work with other distros too. Works when you run the main.py from terminal (no compiled version, no autostart with linux, no systray etch).

    Might contain bad python practices, fist time I ever tried to code in this language.

    Works similar as the windows version, it finds all the sinks (audio sources) that is connected to csgo, and changes the volume for them in the different situations.

    opened by Cookiebot1 0
  • Used to work good, stopped all of a sudden

    Used to work good, stopped all of a sudden

    I got to use it for a few days and all was fine, but one day I just opened it and it had no effects on the sound after getting flashed or dying, etc. I tried reinstalling both the program and csgo and still doesnt work at all anymore.

    opened by papinub2 1
  • Not working well

    Not working well

    I've been using this since it came out and occasionally the volume reduces when dead and won't rise again when starting a round. Sometimes only on the next round will it return to normal.

    opened by yellowmatter 2
  • Advanced Sound Filtering

    Advanced Sound Filtering

    This is beyond what is currently being done, but I was thinking a potential direction for this project could be to use the game integration hooks to enable a band pass filter on the CS audio stream that can attenuate high frequencies. Another option to clip volumes that exceed a certain threshold altogether. I envision this is a lot more work, but wanted to bring it up as an idea.

    Either way, this would entail a transformation on the actual audio stream. My VERY rudimentary research has put me onto using Windows Audio Processing Objects which I believe is something along the lines of what may be needed.

    Wanted to bring up this idea and see what your thoughts are.

    opened by MSamman 3
Releases(v2)
  • v2(Jan 28, 2022)

    Program that lowers volume when you die and get flashed in CS:GO.
    It aims to lower the chance of hearing damage by significantly reducing overall sound exposure.
    Uses game state integration. Anti-cheat safe.

    📖 Usage

    • Download and unzip PatriZero-CSGO-Hearing-Protection.rar
    • Chrome might flag it as a dangerous file because it doesn't know what it is but don't worry, as it is open source you can compile the code for yourself if you don't trust the .exe!
    • Put gamestate_integration_VolumeFix.cfg into your Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
    • Run the .exe
      • You can also change settings in settings.txt. If you want to disable a feature just put the value to 1.00.
      • For example "flashVolume": 1.00 would not change the game volume when flashed. "flashVolume": 0.30 will set the volume to 30% when flashed.
    • To turn it off just right click the icon in the system tray and Quit.
      • Right clicking the system tray icon also shows current settings.

    🎯 How to autostart with Windows

    This is really simple and recommended!

    • Place the main folder where you will not delete it (e.g. C:/ or Documents)
    • Open Start with windows.bat
    • Its done!

    ⚡ Features

    • Adjustable volume reduction (settings.txt)

      • When you die
      • When you get flashed (High pitched flash noise)
      • When bomb explodes
    • System tray icon which shows settings

    • Easy way to autostart with Windows

    Read more

    Source code(tar.gz)
    Source code(zip)
    PatriZero-CSGO-Hearing-Protection.rar(24.54 MB)
  • Release(Jan 27, 2022)

    This is the initial release.

    Its simple, it lowers the volume when it detects a death and returns the volume when you get to freezetime. This effectively means your volume will be low for everything (e.g. Deathmatch) except actual matches (competitive / casual) where there is freezetime.

    Usage

    • Download "PatriZero-Soundfix-Flash-Mute.zip"

    • Chrome / Windows might flag it as a dangerous file because it doesn't know what it is but don't worry, as it is open source you can compile the code for yourself if you don't trust the .exe!

    • Put "gamestate_integration_VolumeFix.cfg" into your "Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg"

    • Run the .exe

      • You can also change how much the volume gets lowered by changing the decimal in "volume.txt"
    • To turn it off just right click the icon in the system tray and Quit.

    Source code(tar.gz)
    Source code(zip)
    PatrikZero-Soundfix-OLD.zip(10.48 MB)
    PatriZero-Soundfix-Flash-Mute.zip(10.48 MB)
    README.html(38.46 KB)
Owner
Patrik Žúdel
Just a student doing fun projects.
Patrik Žúdel
Carnatic Notes Predictor for audio files

Carnatic Notes Predictor for audio files Link for live application: https://share.streamlit.io/pradeepak1/carnatic-notes-predictor-for-audio-files/mai

1 Nov 06, 2021
Audio augmentations library for PyTorch for audio in the time-domain

Audio augmentations library for PyTorch for audio in the time-domain, with support for stochastic data augmentations as used often in self-supervised / contrastive learning.

Janne 166 Jan 08, 2023
Python library for audio and music analysis

librosa A python package for music and audio analysis. Documentation See https://librosa.org/doc/ for a complete reference manual and introductory tut

librosa 5.6k Jan 06, 2023
Xbot-Music - Bot Play Music and Video in Voice Chat Group Telegram

XBOT-MUSIC A Telegram Music+video Bot written in Python using Pyrogram and Py-Tg

Fariz 2 Jan 20, 2022
commonfate 📦commonfate 📦 - Common Fate Model and Transform.

Common Fate Transform and Model for Python This package is a python implementation of the Common Fate Transform and Model to be used for audio source

Fabian-Robert Stöter 18 Jan 08, 2022
This library provides common speech features for ASR including MFCCs and filterbank energies.

python_speech_features This library provides common speech features for ASR including MFCCs and filterbank energies. If you are not sure what MFCCs ar

James Lyons 2.2k Jan 04, 2023
Cobra is a highly-accurate and lightweight voice activity detection (VAD) engine.

On-device voice activity detection (VAD) powered by deep learning.

Picovoice 88 Dec 16, 2022
A Simple Script that will help you to Play / Change Songs with just your Voice

Auto-Spotify using Voice Recognition A Simple Script that will help you to Play / Change Songs with just your Voice Explore the docs » Table of Conten

Mehul Shah 1 Nov 21, 2021
Port Hitsuboku Kumi Chinese CVVC voicebank to deepvocal. / 筆墨クミDeepvocal中文音源

Hitsuboku Kumi (筆墨クミ) is a UTAU virtual singer developed by Cubialpha. This project ports Hitsuboku Kumi Chinese CVVC voicebank to deepvocal. This is the first open-source deepvocal voicebank on Gith

8 Apr 26, 2022
Okaeri-Music is a telegram music bot project, allow you to play music on voice chat group telegram.

Okaeri-Music is a telegram bot project that's allow you to play music on telegram voice chat group

Wahyusaputra 1 Dec 22, 2021
Mentos Music Bot With Python

Mentos Music Bot For Any Query Join Our Support Group 👥 Special Thanks - @OfficialYukki Hey Welcome To Here 💫 💫 You Can Make Your Own Music Bot Fo

Cyber Toxic 13 Oct 21, 2022
C++ library for audio and music analysis, description and synthesis, including Python bindings

Essentia Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPL license.

Music Technology Group - Universitat Pompeu Fabra 2.3k Jan 03, 2023
MusicBrainz Picard

MusicBrainz Picard MusicBrainz Picard is a cross-platform (Linux/Mac OS X/Windows) application written in Python and is the official MusicBrainz tagge

MetaBrainz Foundation 3k Dec 31, 2022
Musillow is a music recommender app that finds songs similar to your favourites.

MUSILLOW The music recommender app Check it out now!!! View Demo · Report Bug · Request Feature About The App Musillow is a music recommender app that

3 Feb 03, 2022
Python library for handling audio datasets.

AUDIOMATE Audiomate is a library for easy access to audio datasets. It provides the datastructures for accessing/loading different datasets in a gener

Matthias 121 Nov 27, 2022
Oliva music bot help to play vc music

OLIVA V2 🎵 Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.7+ PyTgCalls Commands 🛠 For all in group /play - reply to youtube url or song file

SOUL々H҉A҉C҉K҉E҉R҉ 2 Oct 22, 2021
Audio2midi - Automatic Audio-to-symbolic Arrangement

Automatic Audio-to-symbolic Arrangement This is the repository of the project "A

Ziyu Wang 24 Dec 05, 2022
Stevan KZ 1 Oct 27, 2021
A voice assistant which can be used to interact with your computer and controls your pc operations

Introduction 👨‍💻 It is a voice assistant which can be used to interact with your computer and also you have been seeing it in Iron man movies, but t

Sujith 84 Dec 22, 2022
Official implementation of A cappella: Audio-visual Singing VoiceSeparation, from BMVC21

Y-Net Official implementation of A cappella: Audio-visual Singing VoiceSeparation, British Machine Vision Conference 2021 Project page: ipcv.github.io

Juan F. Montesinos 12 Oct 22, 2022