0
0

Hi,

It’s not clear to me what this function does:
can I set a sync point, that calls a callback function, say
at 2000 samples from beginning with AddSynchPoint without using
WAV markers ?
I don’t understand what the parameter “userdata” is for…

Thanks for your help,

Corrado

  • You must to post comments
0
0

Yes. It’s kinda like adding a WAV marker at runtime. You can use the userdata field for whatever you like.

[code:36flvr37]
(define a callback...)

signed char F_CALLBACKAPI mycallback(FSOUND_STREAM *stream, void *buff, int len, int param)
{
printf("SYNCHPOINT at sample %d\n", len);
printf("USERDATA = %d\n", param);
return TRUE;
}

(and then when you’re setting up your stream...)

FSOUND_Stream_SetSynchCallback(stream, mycallback, 0);
FSOUND_Stream_AddSynchPoint(stream, 1000, 0); // add synch points at 1000, 2000 and 3000 samples
FSOUND_Stream_AddSynchPoint(stream, 2000, 0);
FSOUND_Stream_AddSynchPoint(stream, 3000, 0);[/code:36flvr37]

Check out the “stream” example program – it uses synch points.

  • You must to post comments
0
0

Thanks Andrew ! :)
But when I do the FSOUND_AddSynchPoint(stream, 1000, 0)

I get an unhandled exception error…
my machine is Windows XP, PIII 933, Audio Advance –

fmod 3.62

What can be wrong ?

Thanks
Corrado

  • You must to post comments
0
0

I discovered,
If I put, for example, (int)”ww” in the UserData field,
all goes ok !

Corrado

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.