diff --git a/Assets/Plugins/FMOD/fmod.cs b/Assets/Plugins/FMOD/fmod.cs index b21ea1d..c2de18a 100644 --- a/Assets/Plugins/FMOD/fmod.cs +++ b/Assets/Plugins/FMOD/fmod.cs @@ -19,8 +19,8 @@ namespace FMOD */ public partial class VERSION { - public const int number = 0x00020111; -#if !UNITY_2017_4_OR_NEWER + public const int number = 0x00020203; +#if !UNITY_2019_4_OR_NEWER public const string dll = "fmod"; #endif } @@ -146,6 +146,15 @@ namespace FMOD public VECTOR up; } + [StructLayout(LayoutKind.Sequential)] + public partial struct GUID + { + public int Data1; + public int Data2; + public int Data3; + public int Data4; + } + [StructLayout(LayoutKind.Sequential)] public struct ASYNCREADINFO { @@ -187,6 +196,19 @@ namespace FMOD MAX, } + public enum PORT_TYPE : int + { + MUSIC, + COPYRIGHT_MUSIC, + VOICE, + CONTROLLER, + PERSONAL, + VIBRATION, + AUX, + + MAX + } + public enum DEBUG_MODE : int { TTY, @@ -480,6 +502,17 @@ namespace FMOD public StringWrapper functionparams; } + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float dsp; /* DSP mixing CPU usage. */ + public float stream; /* Streaming engine CPU usage. */ + public float geometry; /* Geometry engine CPU usage. */ + public float update; /* System::update CPU usage. */ + public float convolution1; /* Convolution reverb processing thread #1 CPU usage */ + public float convolution2; /* Convolution reverb processing thread #2 CPU usage */ + } + [Flags] public enum SYSTEM_CALLBACK_TYPE : uint { @@ -736,6 +769,7 @@ namespace FMOD public DSP_RESAMPLER resamplerMethod; public uint randomSeed; public int maxConvolutionThreads; + public int maxOpusCodecs; } [Flags] @@ -796,7 +830,7 @@ namespace FMOD } [Flags] - public enum THREAD_AFFINITY : long // avoid ulong for Bolt compatibility + public enum THREAD_AFFINITY : long { /* Platform agnostic thread groupings */ GROUP_DEFAULT = 0x4000000000000000, @@ -865,12 +899,12 @@ namespace FMOD { public static RESULT System_Create(out System system) { - return FMOD5_System_Create(out system.handle); + return FMOD5_System_Create(out system.handle, VERSION.number); } #region importfunctions [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_Create(out IntPtr system); + private static extern RESULT FMOD5_System_Create(out IntPtr system, uint headerversion); #endregion } @@ -920,11 +954,6 @@ namespace FMOD { public static RESULT SetAttributes(THREAD_TYPE type, THREAD_AFFINITY affinity = THREAD_AFFINITY.GROUP_DEFAULT, THREAD_PRIORITY priority = THREAD_PRIORITY.DEFAULT, THREAD_STACK_SIZE stacksize = THREAD_STACK_SIZE.DEFAULT) { - if ((affinity & THREAD_AFFINITY.GROUP_DEFAULT) != 0) - { - affinity &= ~THREAD_AFFINITY.GROUP_DEFAULT; - affinity = (THREAD_AFFINITY)(((ulong)affinity) | 0x8000000000000000); - } return FMOD5_Thread_SetAttributes(type, affinity, priority, stacksize); } @@ -1209,13 +1238,9 @@ namespace FMOD { return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); } - public RESULT getCPUUsage(out float dsp, out float stream, out float geometry, out float update, out float total) - { - return FMOD5_System_GetCPUUsage(this.handle, out dsp, out stream, out geometry, out update, out total); - } - public RESULT getCPUUsageEx(out float convolutionThread1, out float convolutionThread2) + public RESULT getCPUUsage(out CPU_USAGE usage) { - return FMOD5_System_GetCPUUsageEx(this.handle, out convolutionThread1, out convolutionThread2); + return FMOD5_System_GetCPUUsage(this.handle, out usage); } public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) { @@ -1319,7 +1344,7 @@ namespace FMOD } // Routing to ports. - public RESULT attachChannelGroupToPort(uint portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) + public RESULT attachChannelGroupToPort(PORT_TYPE portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) { return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); } @@ -1562,9 +1587,7 @@ namespace FMOD [DllImport(VERSION.dll)] private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out float dsp, out float stream, out float geometry, out float update, out float total); - [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_GetCPUUsageEx (IntPtr system, out float convolutionThread1, out float convolutionThread2); + private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); [DllImport(VERSION.dll)] private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); [DllImport(VERSION.dll)] @@ -1598,7 +1621,7 @@ namespace FMOD [DllImport(VERSION.dll)] private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); [DllImport(VERSION.dll)] - private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, uint portType, ulong portIndex, IntPtr channelgroup, bool passThru); + private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, PORT_TYPE portType, ulong portIndex, IntPtr channelgroup, bool passThru); [DllImport(VERSION.dll)] private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); [DllImport(VERSION.dll)] diff --git a/Assets/Plugins/FMOD/fmod_dsp.cs b/Assets/Plugins/FMOD/fmod_dsp.cs index 5df37d0..92ad06d 100644 --- a/Assets/Plugins/FMOD/fmod_dsp.cs +++ b/Assets/Plugins/FMOD/fmod_dsp.cs @@ -231,7 +231,8 @@ namespace FMOD DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, DSP_PARAMETER_DATA_TYPE_FFT = -4, - DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5 + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, + DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE = -6 } [StructLayout(LayoutKind.Sequential)] @@ -327,6 +328,13 @@ namespace FMOD public float[] channelweight; } + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_ATTENUATION_RANGE + { + public float min; + public float max; + } + [StructLayout(LayoutKind.Sequential)] public struct DSP_DESCRIPTION { @@ -515,7 +523,7 @@ namespace FMOD public enum DSP_NORMALIZE : int { FADETIME, - THRESHHOLD, + THRESHOLD, MAXAMP } @@ -702,6 +710,8 @@ namespace FMOD OVERALL_GAIN, SURROUND_SPEAKER_MODE, _2D_HEIGHT_BLEND, + ATTENUATION_RANGE, + OVERRIDE_RANGE } public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int @@ -880,6 +890,8 @@ namespace FMOD _3D_SOUND_SIZE, _3D_MIN_EXTENT, OVERALL_GAIN, - OUTPUTGAIN + OUTPUTGAIN, + ATTENUATION_RANGE, + OVERRIDE_RANGE } } diff --git a/Assets/Plugins/windows/x86/fmod.dll b/Assets/Plugins/windows/x86/fmod.dll index 6627820..b30885f 100644 Binary files a/Assets/Plugins/windows/x86/fmod.dll and b/Assets/Plugins/windows/x86/fmod.dll differ diff --git a/Assets/Plugins/windows/x86/fmodL.dll b/Assets/Plugins/windows/x86/fmodL.dll index e32cd4e..7c44416 100644 Binary files a/Assets/Plugins/windows/x86/fmodL.dll and b/Assets/Plugins/windows/x86/fmodL.dll differ diff --git a/Assets/Plugins/windows/x86_64/fmod.dll b/Assets/Plugins/windows/x86_64/fmod.dll index 8fd67ab..f9e38be 100644 Binary files a/Assets/Plugins/windows/x86_64/fmod.dll and b/Assets/Plugins/windows/x86_64/fmod.dll differ diff --git a/Assets/Plugins/windows/x86_64/fmodL.dll b/Assets/Plugins/windows/x86_64/fmodL.dll index 9f4586b..0394340 100644 Binary files a/Assets/Plugins/windows/x86_64/fmodL.dll and b/Assets/Plugins/windows/x86_64/fmodL.dll differ