// [TypeInfo RVA: 0x0]
public class VolumeWeightByAudio : MonoBehaviour
{
	public VolumeWeightByAudio.AudioMode mode; // 0x20
	public UnityEngine.AudioSource targetSource; // 0x28
	public int sampleSize; // 0x30
	public UnityEngine.FFTWindow fftWindow; // 0x34
	public UnityEngine.Rendering.Volume volume; // 0x38
	public float minDb; // 0x40
	public float maxDb; // 0x44
	public float weightSmoothing; // 0x48
	private System.Single[] samples; // 0x50
	private float currentWeight; // 0x58

	// RVA: 0x32638C4 VA: 0x781894E8C4
	private void Start();
	/*
	 *   undefined *puVar1;
	 *   void **ppvVar2;
	 *   ulong uVar3;
	 *   void *extraout_x1;
	 *   void *pvVar4;
	 *   undefined8 unaff_x30;
	 *
	 *   puVar1 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   if ((bRam000000000754abb3 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_070c0730);
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8);
	 *     func_0x031fdc8c(PTR_DAT_070c0f68);
	 *     bRam000000000754abb3 = 1;
	 *     methodInfo = extraout_x1;
	 *   }
	 *   ppvVar2 = &this.targetSource;
	 *   pvVar4 = *ppvVar2;
	 *   if (*(int *)(*(long *)puVar1 + 0xe4) == 0) {
	 *     func_0x031fde08(*(long *)puVar1,methodInfo);
	 *   }
	 *   puVar1 = PTR_DAT_070c0f68;
	 *   uVar3 = UnityEngine.Object.op_Equality(pvVar4,null);
	 *   if (((uVar3 & 1) == 0) || (this.mode != 0)) {
	 *     pvVar4 = (void *)func_0x031fdd78(*(undefined8 *)puVar1,this.sampleSize);
	 *     ppvVar2 = &this.samples;
	 *     *ppvVar2 = pvVar4;
	 *   }
	 *   else {
	 *     pvVar4 = (void *)func_0x0373df50(this,*(undefined8 *)PTR_DAT_070c0730);
	 *     this.targetSource = pvVar4;
	 *     unaff_x30 = 0x3363974;
	 *     register0x00000008 = (BADSPACEBASE *)&stack0xffffffffffffffd0;
	 *   }
	 *   if (iRam00000000077785f0 != 0) {
	 *     *(undefined8 *)((long)register0x00000008 + -0x10) = unaff_x30;
	 *     func_0x032ed0c0(1L << ((ulong)ppvVar2 >> 0xc & 0x3f),
	 *                     ((ulong)ppvVar2 >> 0x12 & 0x7fff) * 8 + 0x75ac5c8);
	 *   }
	 *   return;
	 */
	// RVA: 0x326399C VA: 0x781894E99C
	private void Update();
	/*
	 *   undefined *puVar1;
	 *   ulong uVar2;
	 *   VolumeWeightByAudio *extraout_x0;
	 *   VolumeWeightByAudio *extraout_x0_00;
	 *   VolumeWeightByAudio *this_00;
	 *   void *extraout_x1;
	 *   int iVar3;
	 *   void *pvVar4;
	 *   float fVar5;
	 *   float fVar6;
	 *   float fVar7;
	 *   float fVar8;
	 *   float fVar9;
	 *
	 *   if ((bRam000000000754abb4 & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8);
	 *     bRam000000000754abb4 = 1;
	 *     methodInfo = extraout_x1;
	 *   }
	 *   puVar1 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   iVar3 = this.mode;
	 *   if (iVar3 == 0) {
	 *     pvVar4 = this.targetSource;
	 *     if (*(int *)(*(long *)typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8 + 0xe4) == 0) {
	 *       func_0x031fde08(*(long *)typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8,methodInfo);
	 *     }
	 *     uVar2 = UnityEngine.Object.op_Inequality(pvVar4,null);
	 *     if ((uVar2 & 1) == 0) {
	 *       iVar3 = this.mode;
	 *       goto LAB_03363a30;
	 *     }
	 *     if (this.targetSource == null) goto LAB_03363b18;
	 *     pvVar4 = null;
	 *     UnityEngine.AudioSource.GetSpectrumData(this.targetSource,this.samples,0,this.fftWindow);
	 *     this_00 = extraout_x0;
	 * LAB_03363a54:
	 *     fVar5 = VolumeWeightByAudio.CalculateDb(this_00,this.samples);
	 *   }
	 *   else {
	 * LAB_03363a30:
	 *     fVar5 = 0.0;
	 *     if (iVar3 == 1) {
	 *       pvVar4 = (void *)(ulong)(uint)this.fftWindow;
	 *       UnityEngine.AudioListener.GetSpectrumData(this.samples,0,this.fftWindow);
	 *       this_00 = extraout_x0_00;
	 *       goto LAB_03363a54;
	 *     }
	 *   }
	 *   fVar7 = this.minDb;
	 *   fVar8 = 0.0;
	 *   if (fVar7 != this.maxDb) {
	 *     fVar7 = (fVar5 - fVar7) / (this.maxDb - fVar7);
	 *     fVar5 = 1.0;
	 *     if (fVar7 <= 1.0) {
	 *       fVar5 = fVar7;
	 *     }
	 *     fVar8 = 0.0;
	 *     if (0.0 <= fVar7) {
	 *       fVar8 = fVar5;
	 *     }
	 *   }
	 *   fVar9 = this.currentWeight;
	 *   fVar7 = UnityEngine.Time.get_deltaTime();
	 *   pvVar4 = this.volume;
	 *   fVar7 = fVar7 * this.weightSmoothing;
	 *   iVar3 = *(int *)(*(long *)puVar1 + 0xe4);
	 *   fVar5 = 1.0;
	 *   if (fVar7 <= 1.0) {
	 *     fVar5 = fVar7;
	 *   }
	 *   fVar6 = 0.0;
	 *   if (0.0 <= fVar7) {
	 *     fVar6 = fVar5;
	 *   }
	 *   this.currentWeight = fVar9 + (fVar8 - fVar9) * fVar6;
	 *   if (iVar3 == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   uVar2 = UnityEngine.Object.op_Inequality(pvVar4,null);
	 *   if ((uVar2 & 1) != 0) {
	 *     if (this.volume == null) {
	 * LAB_03363b18:
	 *       IL2CPP.ThrowNullReferenceException();
	 *     }
	 *     *(float *)((long)this.volume + 0x2c) = this.currentWeight;
	 *   }
	 *   return;
	 */
	// RVA: 0x3263B1C VA: 0x781894EB1C
	private float CalculateDb(System.Single[] buffer);
	/*
	 *   uint uVar1;
	 *   ulong uVar2;
	 *   ulong uVar3;
	 *   float *pfVar4;
	 *   float fVar5;
	 *
	 *   if (buffer == null) {
	 *     IL2CPP.ThrowNullReferenceException();
	 *   }
	 *   fVar5 = 0.0;
	 *   uVar1 = (uint)*(ulong *)((long)buffer + 0x18);
	 *   if (0 < (int)uVar1) {
	 *     uVar2 = (ulong)(uVar1 & ((int)uVar1 >> 0x1f ^ 0xffffffffU));
	 *     uVar3 = *(ulong *)((long)buffer + 0x18) & 0xffffffff;
	 *     pfVar4 = (float *)((long)buffer + 0x20);
	 *     do {
	 *       if (uVar3 == 0) {
	 *         IL2CPP.ThrowIndexOutOfRangeException();
	 *       }
	 *       uVar2 = uVar2 - 1;
	 *       uVar3 = uVar3 - 1;
	 *       fVar5 = fVar5 + *pfVar4 * *pfVar4;
	 *       pfVar4 = pfVar4 + 1;
	 *     } while (uVar2 != 0);
	 *   }
	 *   fVar5 = (float)func_0x06cb3960(SQRT(fVar5 / (float)(int)uVar1) / _UNK_0134eca0);
	 *   return fVar5 * 20.0;
	 */
	// RVA: 0x3263B90 VA: 0x781894EB90
	public void .ctor();
	/*
	 *   undefined8 uVar1;
	 *   undefined4 uVar2;
	 *   undefined *puVar3;
	 *   undefined8 uVar4;
	 *
	 *   uVar1 = _UNK_0134dd60;
	 *   this.minDb = -80.0;
	 *   this.weightSmoothing = 5.0;
	 *   uVar4 = _UNK_0134dd60;
	 *   _UNK_0134dd60 = (undefined4)uVar1;
	 *   _UNK_0134dd64 = SUB84(uVar1,4);
	 *   uVar2 = _UNK_0134dd64;
	 *   this.sampleSize = _UNK_0134dd60;
	 *   _UNK_0134dd60 = uVar4;
	 *   puVar3 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   this.fftWindow = uVar2;
	 *   if ((bRam000000000755f76f & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8,0);
	 *     bRam000000000755f76f = 1;
	 *   }
	 *   if (*(int *)(*(long *)puVar3 + 0xe4) == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   return;
	 */
}
