How do I get name of an event using EventDesc

Im scripting a basic wrapper of FMOD for my game engine. Right now I only have Master.bank and Master.strings.bank and I can load both of them in and store them in a map.

What I want to be able to do now is to retrieve Event Description to retrieve the name of all event in a Bank to create a look-up table for easy access to work with tool programmer so that they can create a drop down of all available event name. How should I approach this?

Do I also have to copy the meta data folder to my game engine content?

Here are some screenshots of my code atm

void SoundEngine::LoadBank(const std::string& aBankFileName)
{
	//If sound is already exist in mySounds map then dont need to add it in again just return
	const auto bankExisted = myFMOD->myBanks.find(aBankFileName);
	if(bankExisted != myFMOD->myBanks.end())
	{
		return;
	}
	
	std::string path = AddExtensionIfMissing(aBankFileName, ".bank");
	path = GetValidPath(aBankFileName, GetBankPath());
	if(path.empty())
	{
		SoundLogger.Warn("Can not find path " + path);
	}
	FMOD::Studio::Bank* bank = nullptr;
	myFMOD->ErrorCheckWithMessage(myFMOD->myStudioSystem->loadBankFile(path.c_str(), FMOD_STUDIO_LOAD_BANK_NORMAL, &bank), "Can not load in bank " + aBankFileName);
	if(bank)
	{
		myFMOD->myBanks.emplace(aBankFileName, bank);
	}
	//Check for loading state of a bank then log it out
	FMOD_STUDIO_LOADING_STATE loadingState = FMOD_STUDIO_LOADING_STATE_UNLOADED;
	myFMOD->ErrorCheckWithMessage(myFMOD->myBanks.at(aBankFileName)->getLoadingState(&loadingState), "Can not get loading state of bank " + aBankFileName);
	if(loadingState == FMOD_STUDIO_LOADING_STATE_LOADED)
	{
		SoundLogger.Succ(aBankFileName + " finished loading in and can now be use");
	}
}
void SoundEngine::GetEventList(const std::string& aBankName)
{
	const auto bankExisted = myFMOD->myBanks.find(aBankName);
	if(bankExisted == myFMOD->myBanks.end())
	{
		SoundLogger.Warn("There is no bank in bank map recheck the name or you forgot to load in bank, bank name is: " + aBankName);
		return;
	}

	int eventCount = 0;
	myFMOD->WarningCheckWithMessage(bankExisted->second->getEventCount(&eventCount), "Can not get event count for bank " + aBankName);	
	myEventDesList.resize(eventCount); 
	myFMOD->ErrorCheckWithMessage(bankExisted->second->getEventList(myEventDesList.data(), static_cast<int>(myEventDesList.size()), &eventCount), "Can not get event list from bank " + aBankName);
	for(auto& eventDesc : myEventDesList)
	{
	}
}

Hi, it looks like you can retrieve it with FMOD::EventDescription::getPath if the strings bank is loaded. You don’t need to copy the meta data folder since the info is stored in the strings bank.

Hi,

What @aishi1 has suggested is correct. Alternatively, if you wanted to handle this at design-time in Studio, it’s possible to create a script that iterates over all events in a bank, and writes their paths to file for you to parse later.

The “exportGUIDsHeader.js” script in located in your Studio install’s “./scripts” folder provides an example of generating and writing GUIDs to file, in this case a C/C++/C# header - in the process of doing so, it also gets the path of events, buses, etc. in your project to generate the GUIDs. If you wanted to handle this at design-time, it wouldn’t be too difficult to adapt this script to group events et al. by bank instead.