0
0

I have this function in my project:

[code:nknxhd7l]
static void _setLoopEnable(FMOD_CHANNEL * channel,BOOL bEnable)
{
unsigned int position;
unsigned int loopEnd;
FMOD_Channel_SetLoopCount(channel,(bEnable)?-1:0);

//flush the buffer if the loop end point may been evaluated already
FMOD_Channel_GetPosition(channel,&position,FMOD_TIMEUNIT_PCMBYTES);
FMOD_Channel_GetLoopPoints(channel,NULL,FMOD_TIMEUNIT_PCMBYTES,&loopEnd,FMOD_TIMEUNIT_PCMBYTES);

if ((position+STREAM_BUFFER_SIZE)>=loopEnd) {
// FMOD_Channel_SetPosition(channel,position,FMOD_TIMEUNIT_PCMBYTES);
FMOD_Channel_GetPosition(channel,&position,FMOD_TIMEUNIT_PCM);
FMOD_Channel_SetPosition(channel,position,FMOD_TIMEUNIT_PCM);
}
}
[/code:nknxhd7l]

It seems that calling SetPosition with FMOD_TIMEUNIT_PCMBYTES doesn’t flush the buffer, but calling SetPosition with FMOD_TIMEUNIT_PCM does. Am I missing something or is the behavior of SetPosition inconsistant?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.