I’m currently working on trying to get our game to transition more smoothly between music, rather than abruptly stopping and then starting the next track. I’ve been able to get the current track fading out nicely using fade points, but the issue I’m having is that I’m not sure exactly when to actually call stop & delete the old event and start the next queued one. The event remains in the “playing” playback state even when the volume hits 0, which I would expect, but is there any way of knowing that the fade has completed?
Snippet from fading out the music via the fade points:
ulong dspClock; ulong parentClock; result = eventSet.FMODEvent.getChannelGroup(out group); result = group.getDSPClock(out dspClock, out parentClock); FMOD.System system; FMOD.SPEAKERMODE mode; int numSpeakers; studioSystem.getLowLevelSystem(out system); system.getSoftwareFormat(out _SampleRate, out mode, out numSpeakers); const float fadeTime = 1.0f; ulong fadedTime = dspClock + Convert.ToUInt64(fadeTime * _SampleRate); group.addFadePoint(dspClock, fadeTime); group.addFadePoint(fadedTime, 0.0f);