0
0

We are currently working on our precaching mechanism. For this each sound is opened using FMOD_OPENONLY by default.

I hoped there would be a Sound::load() function which could be used to precache the sounds manually then.

Is there an easy way to implement it? Perhaps simply calling Sound::seekData(-1) or sth?

Regards
Felix Kollmann
Boiling Point Studios

  • You must to post comments
0
0

[quote="fkollmann":25wj2snv]We are currently working on our precaching mechanism. For this each sound is opened using FMOD_OPENONLY by default.

I hoped there would be a Sound::load() function which could be used to precache the sounds manually then.

Is there an easy way to implement it? Perhaps simply calling Sound::seekData(-1) or sth?

Regards
Felix Kollmann
Boiling Point Studios[/quote:25wj2snv]

What we do for the streaming file is that after createSound call we call getOpenState() every frame until it returns openState with FMOD_OPENSTATE_READY then we know that the sound is ready for play.

  • You must to post comments
0
0

[quote="malkia":20qfs7rg][quote="fkollmann":20qfs7rg]We are currently working on our precaching mechanism. For this each sound is opened using FMOD_OPENONLY by default.

I hoped there would be a Sound::load() function which could be used to precache the sounds manually then.

Is there an easy way to implement it? Perhaps simply calling Sound::seekData(-1) or sth?

Regards
Felix Kollmann
Boiling Point Studios[/quote:20qfs7rg]

What we do for the streaming file is that after createSound call we call getOpenState() every frame until it returns openState with FMOD_OPENSTATE_READY then we know that the sound is ready for play.[/quote:20qfs7rg]

that’s for FMOD_NONBLOCKING not FMOD_OPENONLY.

What the OP can do is call Sound::readData, but into its own pointer using Sound::lock/unlock.

ie (rough pseudocode, not referencing fmod.hpp at the moment)

[code:20qfs7rg]
void *ptr1, *ptr2;
len len1, len2;

sound->lock(0,lenbytes,&ptr1,&ptr2,&len1,&len2);
sound->readData(ptr1, lenbytes); // or do it in blocks, whatever.
sound->unlock(ptr1,ptr2,len1,len2);
[/code:20qfs7rg]

  • You must to post comments
0
0

btw that only works for sounds that are decompressed into memory. FMOD_CREATECOMPRESSEDSAMPLE does not allow this.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.