0
0

Hello Brett & fmodies,

I’m running into a little problem:

On some particular platforms and formats (xma) the end callback never gets called.

It’s happening in 5-6% of all our non-streaming oneshot (non-looping) sound files.

I’m encoding them as an XMA, and verified that my result is tha same as the xmaencoder.exe, that to say I’m not using the FSB file format.

When I play them, and set the callback, sometimes it’s never get called back.

To remedy this, I use two crude hacks:

The first one is to check whether the FMOD_Sound_GetLength( … TIMEUNIT_MS ) is still less than FMOD_Channel_GetPosition( … TIMEUNIT_MS )

That doesn’t work all the time, as sometimes the sound would just stop playing, and it’s position would be 22 or 23ms, and the length 24.

To fix that, (the second hack), I’m keeping track of what the position was in the previous frame, and if it’s not the same in this one (a frame would be in the 60fps games about 16ms) then the sound stopped, so I’m cleaning it up.

But, I would like really the end callback to work.

I’ll try to prepare today some test data, and send it to you, I’ve tested all versions up to 40210 and even the pre-release beta (402011), and have to test now with 40300

Thanks,
malkia

P.S. Keep them updates coming up :) – I’m testing each new release with our code

  • You must to post comments
0
0

[quote="brett":1jpxpj9z]are you calling System::update? If a sound ends and isplaying is false then the callback will trigger, regardless of the format.[/quote:1jpxpj9z]

Yes I’m calling FMOD_System_Update()

btw – I could not understand from the documentation when I should call FMOD_System_UpdateFinished()

Is the latter function a check whether the previous update had finished, or the current one. E.g. what should be my high-lelel update routine:

soundUpdate1stVariant( void )
{
if( FMOD_System_UpdateFinished() != FMOD_OK )
return;

// do some fmod stuff – play sounds, wait for them, etc.

FMOD_System_Update();
}

OR

soundUpdate2ndVariant( void )
{
FMOD_System_Update();

// do some fmod stuff – play sounds, wait for them, etc.

FMOD_System_UpdateFinished();
}

e.g. in the second case it’s something like System_UpdateBegin, System_UpdateEnd.

I really couldn’t understood it from the documentation (the function is documented, but it’s not descriptive). Also no examples on it.

Cheers,
malkia

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.