Answered
0
0

In my fmodex for iphone project, I write code as:

void   *extradriverdata = 0;
FMOD_IPHONE_EXTRADRIVERDATA ios_extraData=
{
    FMOD_IPHONE_SESSIONCATEGORY_AMBIENTSOUND,
    false, 
    true,
};
extradriverdata = &ios_extraData;
g_FMOD_system->init(g_numFmodChannels, FMOD_INIT_NORMAL, extradriverdata);

Now I upgrade to fmod studio (low level) API, and that code doesn’t compile.
What’s the equivalent code in new API?

  • You must to post comments
Best Answer
2
0

All configuration of the AudioSession API was removed from FMOD to better cooperate with other audio code. You can see examples of configuring the audio session in our examples in common_platform.mm Common_Init.

For reference, you will need to get an instance of the AVAudioSession, set the appropriate category and make the session active before any FMOD usage. This must be performed from an Objective-C code file, i.e. .m or .mm file:

BOOL success = false;
AVAudioSession *session = [AVAudioSession sharedInstance];

success = [session setCategory:AVAudioSessionCategoryAmbient error:nil];
assert(success);

success = [session setActive:TRUE error:nil];
assert(success);
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.