Sound seems to be looping

Hi, im new in the fmod world.

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

		void *extraDriverData = 0;
		ERRCHECK( FMOD::Studio::System::create(&system) );
		ERRCHECK(system->initialize(32, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_NORMAL, extraDriverData));


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

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

		ERRCHECK( eventDescription->loadSampleData() );

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

	FMOD::Studio::EventInstance* eventInstance = NULL;
	ERRCHECK( eventDescription->createInstance(&eventInstance) );
	ERRCHECK( eventInstance->start() );
	ERRCHECK( eventInstance->release() );

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!

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.

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

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?

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 ?