Hi,
Thank you for the explanation. This can still be done on the sound rather than using a programmer instrument.
In the Video playback example, we play the sound on the MasterChannelGroup
. Instead what we want to do is create a new group for the video audio:
The only difference is we will want to call lockChannelGroup()
(FMOD Engine | Studio API Reference - Bus::lockChannelGroup) which will ensure that the channel group is kept in memory when we attach the sound. Here is how I retrieved the channel group:
FMODUnity.RuntimeManager.StudioSystem.getBus("bus:/VideoGroup", out FMOD.Studio.Bus videoGroupBus);
if (videoBus.isValid())
{
videoBus.lockChannelGroup();
FMODUnity.RuntimeManager.StudioSystem.flushCommands();
videoBus.getChannelGroup(out FMOD.ChannelGroup videoChannelGroup);
}
else
{
Debug.Log("Failed to lock Channel Group");
}
You will notice I also call flushCommands()
(FMOD Engine | Studio API Reference - System::flushCommands) which ensures that the lock command is called before the next update.
Just remember to attach your sound to the videoChannelGroup
as we do to the mMasterChannelGroup
and to unlock
the channel group at some point.
Hope this helps!