0
0

Hi,
I have a question.

How can I hande error at FSOUND_Stream_OpenFile in Delphi?
Here is the Source:

procedure TForm1.Button1Click(Sender: TObject);
var
Zene:PFSoundStream;
begin
Fmod.FSOUND_Init(44100,32,0);
Zene:=Fmod.FSOUND_Stream_OpenFile(‘Music.wma’,FSOUND_ENABLEFX,0);
end;

And it source halt, because you can’t use FSOUND_ENABLEFX on Wma.
So, what can I do in Delphi to handle the error? In case of error the function return null. Sorry to write here, but I couldn’t send any message to Delphi forum.

  • You must to post comments
0
0

Use a Try/Catch block like you would in any other Delphi app.

If you’re new to exception handling in Delphi, read up on TApplication’s “OnException” event. You can make your own custom exception handler.

Hope this helps – sugo

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.