0
0

OS: Windows 7 Professional (64bit)
FMOD Version: 4.35.05 Development (32bit)
Development Tool: Visual Studio 2008 SP1 (VC++)

Hi.

I am trying to load a ".fev" file from memory.
I have succeeded to load a ".fev" file, but I couldn’t get an event.

When I call a function "FMOD_EventGroup_GetEventByIndex()",
it returns an error code "FMOD_ERR_FILE_NOTFOUND".

I think that this function tries to load a ".fsb" file from disk.
But, there is no problem when I directly load a ".fev" from disk.

FMOD_EVENT_LOADINFO loadInfo;
loadInfo.size = sizeof(FMOD_EVENT_LOADINFO);
loadInfo.loadfrommemory_length = pFile->GetSize(); // "pFile" has data of ".fev" file from disk

FMOD_RESULT result = FMOD_OK;
result = ::FMOD_EventSystem_Load(GetEventSystem(), pFile->GetData(), &loadInfo, NULL);

FMOD_EVENTGROUP* pEventGroup;
result = ::FMOD_EventSystem_GetGroup(GetEventSystem(), "Test/SE", FALSE, &pEventGroup);

int numEvents = 0;
result = ::FMOD_EventGroup_GetNumEvents(pEventGroup, &numEvents);

for (int i = 0; i < numEvents; i++)
{
FMOD_EVENT* pEvent = NULL;
result = ::FMOD_EventGroup_GetEventByIndex(pEventGroup, i, FMOD_EVENT_DEFAULT, &pEvent);

...

}

What should I do for success?
And can I load a ".fsb" file from memory too?
(I need to pack all sound files into one packed file)

  • You must to post comments
0
0

You can load the FSB into memory as well using System::createSound and EventSystem::preloadFSB. That is what i meant when I said to look at the load_from_memory example, sorry I should have stated that more clearly.

  • You must to post comments
0
0

Oh, I have succeeded.
Thank you very much.

  • You must to post comments
0
0

I have succeeded to get an event when I load a ".fev" file from memory by your solution.
(The sound files are not packed)
And I have looked at the load_from_memory example, but I can’t find a good solution about my needs.

I am using a event system.
So I call a function "FMOD_EventGroup_GetEventByIndex()" or "FMOD_EventGroup_GetEvent()" for getting an event.

If ".fsb" files in a packed file, and I need to load it from memory,
how get I an event by above functions?

  • You must to post comments
0
0

Thank you. I will try it.

  • You must to post comments
0
0

Hi hebikun, welcome to the FMOD Forum.

It sounds like the problem is that it can’t find the FSB, you should be able to fix that by setting the media path. Yes you can load the FSB from memory as well, take a look at the load_from_memory example.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.