FMOD_IPHONE_EXTRADRIVERDATA when upgrade to fmod studio API

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?

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);
2 Likes