Browse Source

Set channels with 0 volume to automatically become virtual. This greatly reduces the number of real channels that are being used.

console
Nico de Poel 5 years ago
parent
commit
756420c5f9
  1. 2
      Assets/Scripts/AudioManager.cs
  2. 2
      engine/Quake/snd_fmod.c

2
Assets/Scripts/AudioManager.cs

@ -83,7 +83,7 @@ public class AudioManager : MonoBehaviour
result = fmodSystem.setSoftwareChannels(MaxRealChannels);
CheckFmodResult(result, "FMOD.System.setSoftwareChannels");
result = fmodSystem.init(MaxVirtualChannels, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
result = fmodSystem.init(MaxVirtualChannels, FMOD.INITFLAGS.VOL0_BECOMES_VIRTUAL, IntPtr.Zero);
CheckFmodResult(result, "FMOD.System.init");
}

2
engine/Quake/snd_fmod.c

@ -59,7 +59,7 @@ void S_Startup(void)
return;
}
result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_NORMAL, NULL);
result = FMOD_System_Init(fmod_system, MAX_CHANNELS, FMOD_INIT_VOL0_BECOMES_VIRTUAL, NULL);
if (result != FMOD_OK)
{
Con_Printf("Failed to initialize FMOD System: %s\n", FMOD_ErrorString(result));

Loading…
Cancel
Save