# FMOD\_IPHONE\_EXTRADRIVERDATA when upgrade to fmod studio API

**URL:** <https://qa.fmod.com/t/fmod-iphone-extradriverdata-when-upgrade-to-fmod-studio-api/12783>\
**Category:** FMOD Studio\
**Created:** [October 28, 2016, 10:54am UTC](https://qa.fmod.com/t/fmod-iphone-extradriverdata-when-upgrade-to-fmod-studio-api/12783 "2016-10-28T10:54:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![notabdc](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@notabdc](https://qa.fmod.com/u/notabdc)\
**Post date:** [October 28, 2016, 10:54am UTC](https://qa.fmod.com/t/fmod-iphone-extradriverdata-when-upgrade-to-fmod-studio-api/12783/1 "2016-10-28T10:54:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [October 31, 2016, 3:54am UTC](https://qa.fmod.com/t/fmod-iphone-extradriverdata-when-upgrade-to-fmod-studio-api/12783/2 "2016-10-31T03:54:42Z")

</div>

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);
```
