• Advertisement

Archived

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

For those familiar with FMOD...

This topic is 5661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Your function is fine, but note that you''re shutting down the entire FMOD system with that FMOD_Close() call (of course, if that was your goal, you have succeeded ).

Share this post


Link to post
Share on other sites

  • Advertisement