Decompiled source of Sweet Noise Reduction Off v1.0.0

NoiseReductionOff.dll

Decompiled 5 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Voice.Unity;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NoiseReductionOff")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoiseReductionOff")]
[assembly: AssemblyTitle("NoiseReductionOff")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SweetNoiseReductionOff
{
	[BepInPlugin("sweet.noisereductionoff", "Noise Reduction Off", "1.0.0")]
	[BepInIncompatibility("xDVitxD.REPO.disable_noise_reduction")]
	public class Plugin : BaseUnityPlugin
	{
		public const string Guid = "sweet.noisereductionoff";

		public const string Version = "1.0.0";

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			new Harmony("sweet.noisereductionoff").PatchAll();
			Log.LogInfo((object)"Noise Reduction Off loaded.");
		}
	}
	[HarmonyPatch(typeof(WebRtcAudioDsp), "Awake")]
	internal static class DspBypassPatch
	{
		private static void Postfix(WebRtcAudioDsp __instance)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			__instance.Bypass = true;
			Recorder component = ((Component)__instance).GetComponent<Recorder>();
			if ((Object)(object)component != (Object)null)
			{
				Plugin.Log.LogInfo((object)("DSP bypassed. Recorder: VoiceDetection=" + component.VoiceDetection + " threshold=" + component.VoiceDetectionThreshold + " samplingRate=" + ((object)component.SamplingRate/*cast due to .constrained prefix*/).ToString() + " frameDuration=" + ((object)component.FrameDuration/*cast due to .constrained prefix*/).ToString() + " bitrate=" + component.Bitrate));
			}
		}
	}
}