Created
January 10, 2019 02:27
-
-
Save ceberous/f188ff0a7c6367cad99e17d318b7cc64 to your computer and use it in GitHub Desktop.
Windows 10 Hold Microphone Volume Constant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from subprocess import check_output | |
| from threading import Timer | |
| import os | |
| # http://www.nirsoft.net/utils/nircmd.html | |
| # http://www.nirsoft.net/utils/nircmd-x64.zip | |
| NircCMD = os.path.join( "C:\\" , "Program Files" , "NirCmd" , "nircmd.exe" ) | |
| NircCMD = '"' + NircCMD + '"' + " setvolume 1 " | |
| VolumeCeiling = 65535 | |
| FractionPercentage = 0.55 | |
| Percentage = str( int( VolumeCeiling * FractionPercentage ) ) | |
| finalCMD = NircCMD + Percentage + " " + Percentage | |
| def setMicVolume(): | |
| check_output( finalCMD , shell=True ) | |
| while True: | |
| t = Timer( 0.01 , setMicVolume ) | |
| t.start() | |
| t.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment