From 756420c5f9360e437116f6f9756b84519cb46dc6 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Tue, 13 Apr 2021 14:06:43 +0200 Subject: [PATCH] Set channels with 0 volume to automatically become virtual. This greatly reduces the number of real channels that are being used. --- Assets/Scripts/AudioManager.cs | 2 +- engine/Quake/snd_fmod.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/AudioManager.cs b/Assets/Scripts/AudioManager.cs index 2916995..1e7f5ce 100644 --- a/Assets/Scripts/AudioManager.cs +++ b/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"); } diff --git a/engine/Quake/snd_fmod.c b/engine/Quake/snd_fmod.c index f7608c8..0ea79cb 100644 --- a/engine/Quake/snd_fmod.c +++ b/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));