Skip to content

Instantly share code, notes, and snippets.

View peteranh's full-sized avatar
💭
Looking for oportunities

Tuan Anh Hoang peteranh

💭
Looking for oportunities
View GitHub Profile
@peteranh
peteranh / lockmicvolume.ps1
Created November 13, 2022 07:16 — forked from Delivator/lockmicvolume.ps1
A little powershell script that sets the default microphone volume to a set value, requires nircmd.exe to be in same directory as the script
# How long it should wait between every loop in seconds
$secondsToWait = 5
# The volume you want in percent (0.92 = 92%)
$volume = 1.00
Write-Host "Starting invinite loop, press CTRL + C or close the window to stop"
while (1) {
Start-Process -FilePath "nircmd.exe" -WorkingDirectory $PSScriptRoot -ArgumentList "setsysvolume $([math]::floor(65535 * $volume))","default_record" -Wait
Write-Host "Volume set to $($volume * 100)%"
Start-Sleep -Seconds $secondsToWait

Keybase proof

I hereby claim:

  • I am peteranh on github.
  • I am peteranh3105 (https://keybase.io/peteranh3105) on keybase.
  • I have a public key ASD2ir5k7Sh0S8DwWJZy49gcmPlG-b4_OlusMvzsar0a7Ao

To claim this, I am signing this object: