Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0187773933/7ff070f0734663c414519117287004b5 to your computer and use it in GitHub Desktop.
Save 0187773933/7ff070f0734663c414519117287004b5 to your computer and use it in GitHub Desktop.
Windows 10 Hold Microphone Volume Constant
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