0
0

Hello,

I can’t seem to get the Callbacks working under Delphi.

I’ve tried this

[code:23hdhnkd]
function CallBackFadeSync(channel: FMOD_CHANNEL; callbacktype: Cardinal; callback: FMOD_CHANNEL_CALLBACK; command: Integer): FMOD_RESULT;
begin
ShowMessage(’Fade point’);
Result := FMOD_OK;
end;

function CallBackEndSync(channel: FMOD_CHANNEL; callbacktype: Cardinal; callback: FMOD_CHANNEL_CALLBACK; command: Integer): FMOD_RESULT;
begin
ShowMessage(’End of stream’);
Result := FMOD_OK;
Command ] );
end;

function TestUnit.Test( aFilename : String ) : Boolean;
begin
if ErrorCheck( FMOD_System_Create( oFMODSystem ) ) then
if ErrorCheck( FMOD_System_SetSpeakerMode( oFMODSystem, FMOD_SPEAKERMODE_5POINT1) ) then
if ErrorCheck( FMOD_System_SetDriver( oFMODSystem, Output ) ) then
if ErrorCheck( ErrorCheck( FMOD_System_Init( oFMODSystem, 6, FMOD_INIT_NORMAL, Nil ) )) then begin
FMOD_Channel_SetCallback( oFMChannel,FMOD_CHANNEL_CALLBACKTYPE_SYNCPOINT, @CallBackFadeSync, PlayerId );
FMOD_Sound_AddSyncPoint( oFMSound, aFadeSync, FMOD_TIMEUNIT_MS, ‘Testpoint’, 10000 );

        FMOD_System_CreateSound( oFMODSystem, PAnsiChar(aFilename), FMOD_SOFTWARE or FMOD_2D or FMOD_CREATESTREAM, Nil, oFMSound)) then
        FMOD_System_PlaySound( oFMODSystem, FMOD_CHANNEL_FREE, oFMSound, True, oFMChannel ) );
        FMOD_Channel_SetPaused( ofmChannel, False )
      end;

end;
[/code:23hdhnkd]

In a timer I also call :
[code:23hdhnkd]FMOD_System_Update( oFMODSystem );[/code:23hdhnkd]
on a regular basis.

The EndPoint is called, but with an error : FMOD Error 33, Invalid handle.

Any one got an idea?

gr. Harold Oudshoorn

  • You must to post comments
0
0

Hello Bret,

In my bigger TestApp I’m also using an EndPoint sync besides the SyncPos.

[quote="brett":170ufxes]hang on, what is returning the error invalid handle? I thought you said callbacks didnt work but ‘endpoint is called.'[/quote:170ufxes]

  • You must to post comments
0
0

Anybody got a working Callback sample using syncpoints mad with AddSyncpoint?

I prefer delphi, but VB, C, C++, C# would do as well.

gr. Harold

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.