0
0

I have this problem:
http://www.youtube.com/watch?v=VMVbxoxi7NA
The problem appears in the video at 00:23
I have no idea why it happens. I think that could be something with the channels or maybe is because these are streams.
Please, if you have any idea about what is the problem, write me.

pd: sorry about my english, i speak spanish.

  • You must to post comments
0
0

I’m not entirely sure what the problem is. I think it is that the sound cuts out the second time you go through the songs. It sounds like the stream buffer is full but once the game has finished playing the buffer the stream is starving. Try connecting to the logging version of FMOD, that will help us diagnose the problem.

  • You must to post comments
0
0

Could be something as simple as forgetting to call SystemUpdate

  • You must to post comments
0
0

I was using only one SystemUpdate call, but i don’t have just one cycle. So I added some others SystemUpdate and the problem was almost solved. But it still happens sometimes. Where should I put the SystemUpdate call?? after every play? after every stop? and what exactly do that call? after I play a stream, i have to do something special?
Another question: is there a call to clean up the buffer?
Thanks for the advices 😀

  • You must to post comments
0
0

You should be calling system update regularly, every 15-30ms. Normally users put it in their main game loop, in this case that would be once per screen update.

  • You must to post comments
0
0

Generaly, you call system update in you main game loop, right before your sleep command which defines your frames per seconds.

Main point is it has to be called constantly at regular interval.

In the case where you would show a dialog box (in windows) you would need to either override the it’s window procedure to call it. Or simpler, create a thread that calls it while in a procedure where you loose control of the code (eg, showing a message box, the system will start to frak out after 5 to 30 seconds).

The thead solution is easiest given you absolutely do not do any FMOD related operation other than calling system update…

From my dll…

[code:3f1f1es6]
HANDLE updatethread = 0;
int threadstate = 0;
DWORD WINAPI UpdateFunction( LPVOID lpParam )
{
while(threadstate == 1)
{
Sleep(16);
if(inited)
FMODUpdate(); //My wrapper fn for system update
}
threadstate = 2;
ExitThread(0);
}
export double FMODUpdateTakeOverWhileLocked()
{
if(!inited) {{FMODASSERT(FMOD_ERR_INITIALIZATION);}}
if(updatethread) {FMODASSERT(FMOD_ERR_INITIALIZED);}
DWORD dontcare = 0;
threadstate = 1;
updatethread = CreateThread(
NULL, // default security attributes
0, // use default stack size
UpdateFunction, // thread function name
0, // argument to thread function
0, // use default creation flags
&dontcare); // returns the thread identifier
return (double) 1;
}

export double FMODUpdateTakeOverDone()
{
if(!inited) {{FMODASSERT(FMOD_ERR_INITIALIZATION);}}
if(!updatethread) {FMODASSERT(FMOD_ERR_INITIALIZED);}
threadstate = 0;
while(threadstate != 2) Sleep(4);
CloseHandle(updatethread);
updatethread = 0;
threadstate = 0;

return (double) 1;

}
[/code:3f1f1es6]

FMODUpdateTakeOverWhileLocked();
MessageBoxA(…);
FMODUpdateTakeOverDone();

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.