Results 1 to 2 of 2

Thread: Syncrhonization help needed!!

  1. #1

    Syncrhonization help needed!!

    Im trying to sync some music to some effects using FMod, but I can't get it to work. Im using FSOUND_Stream_SetSynchCallback to read RIFF markers inside the stream file. (in this case, a wav file.. )

    Here is the C code for making it work, located in the FMod documentation:

    Code:
    signed char endcallback(FSOUND_STREAM *stream, void *buff, int len, int param)
    {
    
    // end of stream callback doesn't have a 'buff' value, if it doesn't it could be a synch point.
    if (buff)
    { 
    printf("\nSYNCHPOINT : \"%s\"\n", buff);
    
    }
    
    return TRUE;
    
    }
    I tried to do a conversion of this to delphi, but it was rather unsuccesfull.
    All I need is the string value of the RIFF markers so I can do a basic IF/case of in my mainloop...
    Please help me.. Thanks in advance.
    BK - we.create (tm)

  2. #2

    Syncrhonization help needed!!

    Ok, so i've managed to come up with the following code:

    [pascal]
    procedure TForm1.Timer1Timer(Sender: TObject);
    var
    Point: Pointer;
    Point2: PChar;
    Number: integer;
    PcmOffset: Cardinal;
    Marker: string;
    begin

    PcmOffset:=FSOUND_XADPCM; //This is probably wrong..
    Number:=FSOUND_Stream_GetNumSyncPoints(stream);
    Point:=FSOUND_Stream_GetSyncPoint(stream,Number);
    Marker:=FSOUND_Stream_GetSyncPointInfo(point,PcmOf fset);


    end;

    [/pascal]

    This code does work, but it doesen't do what I want it to do.
    I want the RIFF markers to be read as the file plays along, but this just gets the total number of markers in the file, and stores the label of the last marker in the variable Marker. So the question is: what do I have to do to create a program to read the markers in realtime? well, I have to use FSOUND_Stream_SetSynchCallback. But, the parameters of this function, (stream: Pointer to the stream to callback when a synch point is reached, callback: Function to call when synch point is reached, and userdata: user data that is passed into the callback.) gives me a VERY hard time.. so please, if you know how to do this, help me out.. Thanks.


    [/i]
    BK - we.create (tm)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •