For those familiar with FMOD...
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
Please sign my petition! Visit the following URL: http://www.petitiononline.com/tftctvoh/petition.html
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]
signed char [functionName](FSOUND_STREAM *, void *, int, int)
[edited by - johnnie2 on August 12, 2002 12:30:31 PM]
________________________________________________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
Sounds good,
I''ll try it out. Thanks much.
- JS
I''ll try it out. Thanks much.
- JS
Please sign my petition! Visit the following URL: http://www.petitiononline.com/tftctvoh/petition.html
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
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
Please sign my petition! Visit the following URL: http://www.petitiononline.com/tftctvoh/petition.html
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 ).
________________________________________________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement