Created
April 12, 2020 02:09
-
-
Save 0187773933/7ff070f0734663c414519117287004b5 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 | |
# https://www.python.org/downloads/windows/ | |
# 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