0
0

I’m building an app using FMOD Studio, and I’ve created a bunch of small events, containing only one audio file module. I haven’t changed any settings away from the defaults on either the event or the module on any of these small events.

My assumption was that these events would be one-shot, and only play as long as the single audio module.

What seems to happen, though, is that when I instantiate the event and call [b:69q08phr]eventInstance.start()[/b:69q08phr] in my code, the audio loops indefinitely until I call [b:69q08phr]eventInstance.stop()[/b:69q08phr].

I can see that an [b:69q08phr]EventDescription[/b:69q08phr] has an [b:69q08phr]isOneshot[/b:69q08phr] accessor in the API, which would imply that I can set an event to oneshot somewhere in Studio, but I can’t find anything in the UI or the docs.

Am I missing something really obvious here?

  • You must to post comments
0
0

Update: I did try immediately releasing the instance after starting it, but still the same looping behaviour.

I have solved my problem, but it’s a really hacky hack:
[code:35c88wed]
eventInstance.start()
FMOD::ChannelGroup *grp;
eventInstance.getChannelGroup( &grp );
FMOD::ChannelGroup *sub;
grp->getGroup( 0, &sub );
FMOD::Channel *chnl;
sub->getChannel(0, &chnl);
chnl->setMode(FMOD_LOOP_OFF);
[/code:35c88wed]

There must be a better way than this? Surely there’s a setting in the Studio UI on a sound module? I can see a little loop button on the Sound item in the Deck when the module’s selected, but whether it’s toggled on or off doesn’t seem to make any difference.

  • You must to post comments
0
0

It sounds like you may not be calling System::update(). The Studio API is built on the assumption that your game will call System::update() regularly (usually once per frame). If you are not doing this, you will run into playback issues like the one you describe. If you are calling System::update() regularly, then this is a bug; please let us know and we’ll look into it.

  • You must to post comments
0
0

That did the trick, thanks Ben.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.