In my project, I’m going to load all sound data from memory instead of individual files. I’ve figured out that I have two options: to use registerMemoryFSB, or to replace the file system callbacks with my own. For now, I think registerMemoryFSB is the way to go, but it is still a bit unclear how the register/unregister functions should be used.
Let’s say I want to load the data for an event group. From what I’ve understood, this is how I’m going to load the event data (error checks omitted).
// Get the event group.
FMOD::EventGroup* group = NULL;
eventSystem->getGroup(groupName, true, &group);
// This is where I would load the fsb files to memory from a resource pack.
// The actual load operation:
eventSystem->registerMemoryFSB(fsbFilename, fsbData, fsbDataLen, false);
// Now I can use the events within the loaded event group.
Does this work?
If this is not how the register/unregister calls are used, should I be unregistering the memory fsb only when I have finished using the event group (that is, after freeEventData has been called and any events within the group are not to be used anymore)?
- JoniM asked 10 years ago
- You must login to post comments