0
0

Hi, im new in the fmod world.

im using fmod studio android version, with cocos2dx, this is my code

[code:1iktc3lg]
void *extraDriverData = 0;
ERRCHECK( FMOD::Studio::System::create(&system) );
system->getLowLevelSystem(&lowLevelSystem);
CCLOG("syst->init");
ERRCHECK(system->initialize(32, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_NORMAL, extraDriverData));

    loadBanks("Weapons.bank");

    FMOD::Studio::ID explosionID = {0};
    CCLOG("lookupID");
    ERRCHECK( system->lookupID("event:/Explosions/Single Explosion", &explosionID) );

    FMOD::Studio::EventDescription* eventDescription = NULL;
    CCLOG("getEvent");
    ERRCHECK(system->getEvent(&explosionID, FMOD_STUDIO_LOAD_BEGIN_NOW, &eventDescription));

    ERRCHECK( eventDescription->loadSampleData() );

[/code:1iktc3lg]

this is just the "init" function.

in my game loop i have the system->update()

and when i click in the screen im trying to play this sound

[code:1iktc3lg]
FMOD::Studio::EventInstance* eventInstance = NULL;
ERRCHECK( eventDescription->createInstance(&eventInstance) );
ERRCHECK( eventInstance->start() );
ERRCHECK( eventInstance->release() );
[/code:1iktc3lg]

the main problem is: when i "play" the sound it starts, and seems to be looping playing and playing, and everything i hear is ascending noise…

im not sure what am i doing wrong, the bank is loading properly, the event instance seems to be ok since im being able to give it a ->start, but im kinda lost on what im hearing.

any ideas ?

thanks in advance!

  • You must to post comments
0
0

Those messages are coming from FMOD Studio’s handle validation. In particular the "mgr" assert would only happen if certain bits of the handle referred to a system that didn’t exist. Most likely that is one of two things: Either the underlying Studio system was destroyed, or else the pointer is actually garbage and was never valid in the first place.

It won’t cause a crash, but it probably means something is logically wrong in the calling code. If you need additional help, I’d suggest contact FMOD support with a test case and we can identify what is happening.

  • You must to post comments
0
0

apparently i was updating the lowlevel system not the studio system, and that was my main problem, now everything is working ok, thanks :)

  • You must to post comments
0
0

That code looks fine. That second section where you play the event, is that code getting executed repeatedly causing them to stack up? Also are you calling Studio::System::update regularly?

  • You must to post comments
0
0

Actually i was missing things on my .java file. After fixing that the banks worked good, thanks.

on the other hand, im having this msg on every tick (im calling system->update(); on every tick of my gameloop).

I/fmod (15212): FMOD: assert : assertion: ‘mgr’ failed
I/fmod (15212): ../../src/fmod_weakhandle_system.cpp(247) : FMOD error (33) : An invalid object handle was used.
I/fmod (15212): FMOD: Debug_OutputTrace : ../../src/fmod_weakhandle_system.cpp(247) : FMOD error (33) : An invalid object handle was used.

so im trying to figure whats this and why it doesnt want to work.

any ideas ?

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.