Hi
Looks like you are working with delphi XE/Xe2
from the ground up this code can produce errors!
should be
function GetAudioFileHandle (f_name : String) : HSTREAM;
var
l_chan : HSTREAM;
l_ext : String;
begin
if FileExists (f_name) then
begin
l_ext := AnsiUppercase (ExtractFileExt (f_name));
l_chan := BASS_StreamCreateFile(FALSE,PChar(f_name),0,0,0 or BASS_UNICODE);
if l_chan =0 then
l_chan := BASS_FLAC_StreamCreateFile(FALSE,PChar(f_name),0,0,0 or BASS_UNICODE)
else if l_chan = 0 then
l_chan := BASS_WMA_StreamCreateFile(FALSE,PChar(f_name),0,0,0 or BASS_UNICODE)
else if l_chan = 0 then
l_chan := BASS_WV_StreamCreateFile(FALSE,PChar(f_name),0,0,0 or BASS_UNICODE);
Result := l_chan;
end;
Why do you not work with the Plugin Stuff ??
In you code you will only check the extension what is if one user have renamed a e.g mp3 to flac??
A better way is to check the Handle.
(take a look in the Delphi Plugins Demo).
But about your Problem are you using specialy Delphi Components?
So I can`t here reproduce here your error!
Chris