Sometimes,the function returns 0,but obviously the event timeline length is not 0.

ERRCHECK( explosionDescription->loadSampleData() );
int dd = -1;

ss is false and s is loaded,but dd is still 0.


And below is my fmod init code:

void *extraDriverData = NULL;

FMOD::Studio::System* system = NULL;
ERRCHECK( FMOD::Studio::System::create(&system) );

// The example Studio project is authored for 5.1 sound, so set up the system output mode to match
FMOD::System* lowLevelSystem = NULL;
ERRCHECK( system->getLowLevelSystem(&lowLevelSystem) );
ERRCHECK( lowLevelSystem->setSoftwareFormat(0, FMOD_SPEAKERMODE_5POINT1, 0) );

ERRCHECK( system->initialize(32, FMOD_STUDIO_INIT_NORMAL, FMOD_INIT_NORMAL, extraDriverData) );
  • You must to post comments
Good Answer

Have you checked the return value from Studio::EventDescription::getLength? Perhaps there was an error.

  • Danny

    I checked it,but no error happened.I have posted my code above.

  • Graeme Webb

    In your code, is explosionDescription referring to the “Single Explosion” event in the Studio examples project? If so, then its timeline is empty, and thus Studio::EventDescription::getLength should return 0.

    Note that Studio::EventDescription::getLength returning 0 doesn’t necessarily mean that the event won’t play anything. It just means there are no sounds on the timeline. In the explosion example, it has sounds on the “Size” parameter and these will play according to the parameter’s value.

    So Studio::EventDescription::getLength is just an informational function, telling you how long the timeline will tick before it runs out. The actual length of time that an event plays can vary according to the parameter values, transitions, loops, sustain points, pitch, AHDSR, etc.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.