0
0

Hi, has anyone discovered a faster way to add syncpoints to a sound? I have over 3000 sync points which takes over 20 seconds to add.

Here is some test code I wrote:

[code:2j6bz8ma]
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel = 0;
FMOD_RESULT result;
int key;
unsigned int version;

/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);

result = system->getVersion(&version);
ERRCHECK(result);

if (version < FMOD_VERSION)
{
printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION);
return 0;
}

result = system->init(1, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);

printf("start\n");

//result = system->createSound("syncsound.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound);
result = system->createStream("syncsound.ogg", FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &sound);
ERRCHECK(result);
result = system->playSound(FMOD_CHANNEL_FREE, sound, true, &channel);
ERRCHECK(result);

printf("sound loaded. adding sync points\n");

for (unsigned int i=0;i<3000;i+=1) {
FMOD_SYNCPOINT *sp;
sound->addSyncPoint((unsigned int)i,FMOD_TIMEUNIT_PCM,"",&sp);
}

printf("sync points added. done.\n");

/*
Shut down
*/
result = sound->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);

return 0;
[/code:2j6bz8ma]

The loop just adds a syncpoint on the first 3000 sample points for testing. In practice, these syncpoints are spread out over a large file.

I thought maybe it was because I was streaming in the sound and so the sound wasn’t fully loaded when I was setting the point but then doing createSound instead of createStream yielded the same results. Also, the size of the sound file doesn’t matter.

Does anybody have any ideas to speed this up?

Thanks!

-j

  • You must to post comments
0
0

If you don’t want to waste time adding syncpoints at run time you can put them into the sound files using sound editing software like soundforge.

-Pete

  • You must to post comments
0
0

Try adding then in reverse order. It may be because fmod scans the sorted list from start to end when you call addSyncPoint.

  • You must to post comments
0
0

Hi,

Sorry for my English but I am French

I have the same problem with addSyncPoint.

I have to synchronize loops of 6000 points with addSyncPoint . When I used FMOD version 4.06 it was 3 seconds but with FMOD 4.40 requires 45s. Is this a bug?

Think You

😀

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.