0
0

Hi all~

I’m trying to use musicsystem in my project but I come across some problems.

I only make some changes to the fmod designer example "musicsystem", here is the code i added:

[code:1wve16lj]
......

void         *buff = 0;
int          length = 0;
FMOD_EVENT_LOADINFO  loadinfo;
FMOD_CREATESOUNDEXINFO exinfo;
FMOD::Sound      *pSound;

ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL));
ERRCHECK(result = eventsystem->setMediaPath("..\\media\\"));

LoadFileIntoMemory("../media/examples.fev", &buff, &length);
memset(&loadinfo, 0, sizeof(FMOD_EVENT_LOADINFO));
loadinfo.size = sizeof(FMOD_EVENT_LOADINFO);
loadinfo.loadfrommemory_length = length;

ERRCHECK(result = eventsystem->load((const char *)buff, &loadinfo, &eventproject));

//ERRCHECK(result = eventsystem->load("examples.fev", 0, 0));

LoadFileIntoMemory("../media/tutorial_bank.fsb", &buff, &length);
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.length = length;

ERRCHECK(result = system->createSound((const char *)buff, FMOD_SOFTWARE | FMOD_OPENMEMORY, &exinfo, 

&pSound));
ERRCHECK(result = eventsystem->preloadFSB("tutorial_bank.fsb", 0, pSound));
......

[/code:1wve16lj]

And when i trigger either of those musicprompts, which have several segments with samples to loop in them, to start, it becomes mute when some samples have been played only once! No same sample has been heared twice, and then no matter how many times i trigger the musicprompts to end or start, there is nothing playing.

This example works perfect if no changes have been made to it, so i think is there something wrong with my code which i cannot figure out? 😥

  • You must to post comments
0
0

Another problem is that when triggering these musicprompt to end, a FMOD_ERR_PRELOADED is raised just after the next EventSystem::update, stating a specified sound is to be released without calling EventSystem::unloadFSB. The only sound I create is the one holding "fsb" file, and I never release it in my code. I wonder if it is FMOD trying to release it?

  • You must to post comments
0
0

Thanks for the report! This was a bug in the way the music system handles preloaded FSBs. It has been fixed for the next release. Apologies for not getting to this sooner.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.