0
0

FMOD. 3.72, delphi5

Can someone help me sending a sample of code implementing this callback?

I tried to check the samples :

function EndStreamCallback(Stream: PFSoundStream; Buff: Pointer; Len, Param: Integer): ByteBool; stdcall;
var
Count: Integer;
Buffer: PChar;
begin
Buffer := PChar(Buff);

Str(FSOUND_Stream_GetTime(Stream) / 1000: 6: 3, Time);
Str(FSOUND_GetCPUUsage: 7: 5, CPU);
Str(Integer(Buff), BuffStr);
Str(Len, LenStr);
Status := ‘Callback: Buff=’ + BuffStr + ‘ Len=’ + LenStr + ‘ Time=’ + Time + ‘ CPU=’ + CPU;
showmessage(Status);

// Must return true for the stream to continue
Result := True;
end;

and I tried to implement the callback here:
FSongs[Index].Channel := FSOUND_Stream_Play(FSOUND_FREE, FSongs[Index].Stream);
FSOUND_stream_SetEndcallback(FSongs[Index].stream, @EndStreamCallback, Index);

The callback was never called;

I tried also
Stream := FSOUND_Stream_Open(PChar(dlgOpen.Files[Index]), FSOUND_NORMAL or FSOUND_LOOP_NORMAL, 0, 0);
FSOUND_stream_SetEndcallback(FSongs[Index].stream, @EndStreamCallback, Index);

Not working also;

May be I’m wrong calling the address of the callback function?

My main problem is to fire an event when I finished to stream an MPEG file;

thank you in advance

SE

  • You must to post comments
0
0

you dont need the @ in the endstreamcallback, should be
FSOUND_stream_SetEndcallback(FSongs[Index].stream, EndStreamCallback, Index);

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.