Archived

This topic is now archived and is closed to further replies.

jmszczap82

For those familiar with FMOD...

Recommended Posts

Hi, I''m writing a demo in C++ that will loop a "demo.mp3" stream while running. Everything is in working order, but I have a question about the "FSOUND_Stream_Close" function. How do I tell my app. to call this function when the stream is done playing? - JS

Share this post


Link to post
Share on other sites
Give the stream a custom callback function with FSOUND_Stream_SetEndCallback(). When the stream is complete, it will call the provided function, in which you can call FSOUND_Stream_Close(), queue up another stream to be played, etc. The callback function must be of the form:

signed char [functionName](FSOUND_STREAM *, void *, int, int)

[edited by - johnnie2 on August 12, 2002 12:30:31 PM]

Share this post


Link to post
Share on other sites
Hi,
It seems to have worked, but let me double-check here...
1. I put "FSOUND_Stream_SetEndCallback(stream, endcallback, 0);" in WinMain.
2. I add the following function to my program:
"signed char endcallback(FSOUND_STREAM *Demo, void *buff, int len, int param)
{
FSOUND_Stream_Close(Demo);
FSOUND_Close();
return TRUE;
}"
Does this sound at all correct? Keep in mind that I''m new to this, so if you see a horrible mistake, that''s why
- JS

Share this post


Link to post
Share on other sites