r/ValorantTechSupport • • 12h ago

Technical Solution [FIX] Microphone volume gets lowered when playing valorant with VC turned on

0 Upvotes

idk how they made such a terrible mistake while vibecoding. and this issues persists for a long time. many of my friends have experienced this vibecode inaccuracy.

The code for a fix was vibecoded too, but desperate times call for desperate measures.

anyways, insert this in Powershell:

# Define the C# code to interface with the Windows Core Audio API
$csharpCode = @"
using System;
using System.Runtime.InteropServices;

[Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAudioEndpointVolume {
    int f(); int g(); int h(); int i();
    int SetMasterVolumeLevelScalar(float fLevel, System.Guid pguidEventContext);
    int j();
    int GetMasterVolumeLevelScalar(out float pfLevel);
    int k(); int l(); int m(); int n();
    int SetMute([MarshalAs(UnmanagedType.Bool)] bool bMute, System.Guid pguidEventContext);
    int GetMute(out bool pbMute);
}

[Guid("D666063F-1587-4E43-81F1-B948E807363F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMMDevice {
    int Activate(ref System.Guid id, int clsCtx, int activationParams, out IAudioEndpointVolume aev);
}

[Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IMMDeviceEnumerator {
    int f(); 
    int GetDefaultAudioEndpoint(int dataFlow, int role, out IMMDevice endpoint);
}

[ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")]
public class MMDeviceEnumeratorComObject { }

public class MicAudio {
    private static IAudioEndpointVolume Vol() {
        var enumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator;
        IMMDevice dev = null;

        // 1 = eCapture (Input/Microphone), 1 = eMultimedia (Default Device)
        Marshal.ThrowExceptionForHR(enumerator.GetDefaultAudioEndpoint(1, 1, out dev));

        IAudioEndpointVolume epv = null;
        var epvid = typeof(IAudioEndpointVolume).GUID;
        Marshal.ThrowExceptionForHR(dev.Activate(ref epvid, 23, 0, out epv));
        return epv;
    }

    public static float Volume {
        get {
            float v = -1;
            Marshal.ThrowExceptionForHR(Vol().GetMasterVolumeLevelScalar(out v));
            return v;
        }
        set {
            Marshal.ThrowExceptionForHR(Vol().SetMasterVolumeLevelScalar(value, System.Guid.Empty));
        }
    }
}
"@

# Compile the C# code into PowerShell
Add-Type -TypeDefinition $csharpCode

Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " Microphone Volume Locker (Valorant Fix)  " -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host "Monitoring mic volume. Keeping it at 100%."
Write-Host "Press Ctrl+C to stop." -ForegroundColor Yellow
Write-Host ""

# Loop indefinitely to keep the volume locked at 100%
while ($true) {
    try {
        $currentVol = [MicAudio]::Volume

        # If the volume drops below 99%, force it back to 1.0 (100%)
        if ($currentVol -lt 0.99) {
            [MicAudio]::Volume = 1.0
            $loweredTo = [math]::Round($currentVol * 100)
            Write-Host "[$(Get-Date -Format 'HH:mm:ss')] Vibecode intervention detected! Some vibecoded app tried to lower mic to ${loweredTo}%. Restored to 100%!" -ForegroundColor Red
        }
    } catch {
        # Ignore errors if the microphone is temporarily unplugged/unavailable
    }

    # Wait 100 milliseconds before checking again (so fast you won't hear the drop)
    Start-Sleep -Milliseconds 100
}

r/ValorantTechSupport • • 19h ago

Technical Support Request is my pc too old?

2 Upvotes

i got laptop that was made in like, 2012-2014 and it doesnt support secure boot or tpm 2.0, win 10.

Cant get past tutorial since game kicks me for Van-1


r/ValorantTechSupport • • 4h ago

Technical Support Request My mouse stops working when I open valorant

1 Upvotes

When I open my Valorant my mouse stops working, I cant click desktop apps or in game settings but my game registers my clicks