0
0

Hi everyone, could someone explain me how to use this function ? I need to play another song ( I know how to do that ) when the other song finished playing that’s why I need FSOUND_SetEndCallback. I’ve searched through the “help” that comes with FSOUND but I can’t understand how to make it work… they say the 2nd parameter must be a FSOUND_STREAMCALLBACK, so I give it one, but I can’t handle anything that way because I can’t pass it a function :(

I hope someone understand what I mean.

  • You must to post comments
0
0

Hi again, I’m sorry to bother again but I couldn’t figure it out alone, I’ll show you the code I’m using, can you tell me what’s wrong ? When the song/sound finishes, the message box doesn’t pops up

[code:mj0sd1fm]void F_CALLBACKAPI NextSong( FSOUND_STREAM* stream, void* buff, int len, int param )
{
MessageBox( NULL, NULL, NULL, 0 ) ;
return 0 ;
}

// somewhere else...
FSOUND_Stream_SetEndCallback( g_soundStream, ( FSOUND_STREAMCALLBACK ) NextSong, 0 ) ;[/code:mj0sd1fm]

What’s wrong ?

  • You must to post comments
0
0

[code:268kqpdc]
// first error : signed char expected
signed char F_CALLBACKAPI NextSong( FSOUND_STREAM* stream, void* buff, int len, int param )
{
MessageBox( NULL, NULL, NULL, 0 ) ;

return 1; // second error : you returned 0
}

// somewhere else...
FSOUND_Stream_SetEndCallback( g_soundStream, NextSong, 0 ) ;

[/code:268kqpdc]

  • You must to post comments
0
0

Hi again, thanks for the correction but it still doesn’t work, what I mean is the pop up box ( or whatever I code to test if the callback has been reached ) never executes. Why doesn’t the callback executes ? Maybe I didn’t understand the purpose of the function ? It is supposed to call the callback function as soon as the music ends right ?

PS: I have tried to change the FSOUND_LOOP_NORMAL to FSOUND_LOOP_OFF but it doesn’t work either.

  • You must to post comments
0
0

Call me blind, but I don’t see a function called FSOUND_SetEndCallback in the documentation.

  • You must to post comments
0
0

Stodge, the function is
[quote:4ha11rpo]FSOUND_Stream_SetEndCallback[/quote:4ha11rpo]
not [quote:4ha11rpo]FSOUND_SetEndCallback[/quote:4ha11rpo] 😉

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.