0
0

Hi,

I’m trying to minimise latency in my iPhone app and I’ve noticed in the debugger that both system->createSound as well as system->createStream test the sound file header sequentially for sound file format. As I use mp3 files, they’re number 5 or 6 in the test sequence, so I figured there might be some latency gained if I could tell the function what type of sound file it is. I’ve tried the following flags, but neither had any effect:

[code:2fsxq32k]result = system->createStream(buffer, FMOD_SOFTWARE | FMOD_LOOP_OFF | FMOD_SOUND_TYPE_MPEG, NULL, &sound1);[/code:2fsxq32k]

or

[code:2fsxq32k]result = system->createStream(buffer, FMOD_SOFTWARE | FMOD_LOOP_OFF | FMOD_SOUND_FORMAT_MPEG, NULL, &sound1);[/code:2fsxq32k]

Any pointers be much appreciated.

  • You must to post comments
0
0

I suggest you remove the FMOD_SOUND_TYPE_MPEG you are ORing in, you should only pass in FMOD_MODE flags or you will get unexpected behaviour.

What you can do is pass in a FMOD_CREATESOUNDEXINFO struct to createStream with the "suggestedsoundtype" member set to FMOD_SOUND_TYPE_MPEG (or whatever format you want).

ie:

[code:204t0dqw]

FMOD_CREATESOUNDEXINFO exinfo;

memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO ));

exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO );
exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_MPEG;

result = system->createStream(buffer, FMOD_SOFTWARE | FMOD_LOOP_OFF , &exinfo, &sound1);
ERRCHECK(result);

[/code:204t0dqw]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.