setDSPBufferSize with recent 1.03.04 version


I just upgraded to FMOD Studio 1.03.04 and was running on dec 2013 version before.
When calling setDSPBufferSize(512,2), I am now getting the following error:“Cannot call this command after System::init.” And the sounds definitely seem to be lagging a lot on iOS.

Obviously I can’t move the call to setDSPBufferSize before the initialize call since the low level system doesn’t exist yet, so what would be the proper way of handling this.

Below the code that used to work.

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

    // <!-- l --><a class="postlink-local" href="">viewtopic.php?f=7&t=16135&p=54554&hilit=android#p54562</a><!-- l -->
    FMOD::System* lowLevelSystem = NULL;
    ERRCHECK( _system->getLowLevelSystem(&lowLevelSystem) );
    if( lowLevelSystem )
        ERRCHECK( lowLevelSystem->setDSPBufferSize(512,2) );

You can call getLowLevelSystem() between create() and initialize().

setDSPBufferSize() has always needed to be called before initialize. I’m surprised it wasn’t returning an error code in earlier versions.