Decompiled source of Disable Noise Reduction v1.2.1

DisableNoiseReduction.dll

Decompiled a day ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using POpusCodec.Enums;
using Photon.Voice;
using Photon.Voice.IOS;
using Photon.Voice.Unity;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("DisableNoiseReduction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DisableNoiseReduction")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("35c7e6b1-6adf-4716-95c0-f7b98d383cfe")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DisableNoiseReduction;

[BepInPlugin("xDVitxD.REPO.disable_noise_reduction", "Disable Noise Reduction", "1.2.0")]
public class DisableNoiseReductionMod : BaseUnityPlugin
{
	public const string PluginGUID = "xDVitxD.REPO.disable_noise_reduction";

	public const string PluginName = "Disable Noise Reduction";

	public const string PluginVersion = "1.2.0";

	public static ManualLogSource PluginLogSource;

	public void Awake()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		PluginLogSource = ((BaseUnityPlugin)this).Logger;
		PluginLogSource.LogInfo((object)"Plugin: \"Disable Noise Reduction\" Started!");
		Harmony val = new Harmony("vit.repo.disable_noise_reduction");
		val.PatchAll(typeof(WebRtcAudioDsp_Patches));
		val.PatchAll(typeof(Recorder_Patches));
	}
}
[HarmonyPatch(typeof(WebRtcAudioDsp))]
public class WebRtcAudioDsp_Patches
{
	[HarmonyPatch("AdjustVoiceInfo")]
	[HarmonyPrefix]
	public static bool WebRtcAudioDsp_Patch()
	{
		return false;
	}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public static class Recorder_Patches
{
	[HarmonyPostfix]
	public static bool Recorder_Patch(Recorder __instance, ref float ___voiceDetectionThreshold, ref int ___voiceDetectionDelayMs, ref LocalVoice ___voice, ref bool ___transmitEnabled, ref bool ___loopAudioClip, ref bool ___recordingEnabled, ref AudioSessionParameters ___audioSessionParameters, ref AndroidAudioInParameters ___androidMicrophoneSettings, ref bool ___useMicrophoneTypeFallback, ref bool ___recordWhenJoined, ref DeviceInfo ___microphoneDevice, ref SamplingRate ___samplingRate, ref FrameDuration ___frameDuration, ref int ___bitrate)
	{
		___voiceDetectionThreshold = 0f;
		___samplingRate = (SamplingRate)48000;
		___frameDuration = (FrameDuration)40000;
		___bitrate = 510000;
		return true;
	}
}