0
0

I was just wondering if I’m doing something wrong with stream sync callbacks. I’ve opened up the wavefile in goldwave and dropped a few markers and given each one a name and description. I then save it as a wav-file to preserve the markers (i’ll convert to mp3-wav when i’m finished).

I then use the code below to print out the marker when it comes across it. However, when Lyric_Printer is called, all it does is print a newline. After doing some investigating, i’ve worked out that the string passed to *Lyrics is empty (strlen returned zero).

So, I decided to add my own sync point using fmod itself (stream_addsyncpoint) and to my surprise, it worked. Now, i’m left with a dialemma. Adding a point in fmod works, but in goldwave it doesn’t, yet when i open the wave file in goldwave it says the markers are there (name and description).

HELP!

FSOUND_STREAM *Stream = NULL;

signed char F_CALLBACKAPI Lyric_Printer (FSOUND_STREAM *S, void *Lyrics, int Length, int Param)
{
printf (“%s\n”, Lyrics);

return TRUE;

}

int main(int argc, char* argv[])
{
FSOUND_Init (44100, 4, 0);

if (!(Stream = FSOUND_Stream_Open ("test.wav", FSOUND_LOOP_NORMAL, 0, 0)))
{
    FSOUND_Close ();
    return 0;
}

FSOUND_Stream_SetSyncCallback (Stream, Lyric_Printer, 0);

FSOUND_Stream_Play (FSOUND_FREE, Stream);

while (!_getch ())
{
    FSOUND_Update ();
}

FSOUND_Stream_Close (Stream);

FSOUND_Close ();

return 0;

}

  • You must to post comments
0
0

It works perfectly now!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.