Based on the Bass documentation, I'm trying to load an ordinary ogg file, with the following code:
var
FFile : string;
Music: HSAMPLE;
ch: HCHANNEL;
OpenDialog1 : TOpenDialog;
begin
Dynamic_Bass.Load_BASSDLL('Library/Bass.dll');
Dynamic_Bass.BASS_Init(1,44000,Bass_DEVICE_SPEAKERS,0,nil);
OpenDialog1 := TOpenDialog.Create(nil);
if not OpenDialog1.Execute then
Exit;
ffile := OpenDialog1.FileName;
Music := BASS_SampleLoad(FALSE, PChar(ffile), 0, 0, 3, BASS_SAMPLE_OVER_POS);
ch := BASS_SampleGetChannel(Music, False);
BASS_ChannelSetAttribute(ch, BASS_ATTRIB_PAN, 0);
BASS_ChannelSetAttribute(ch, BASS_ATTRIB_VOL, 1);
BASS_ChannelPlay(ch, False);
ShowMessage(IntToStr(BASS_ErrorGetCode));
end;
It shows the number 5 that according to the documentation, is an error in handle , in this case, in my variable music
. If I comment on these lines below BASS_SampleLoad
, the code changes to 2, which means that the file can not be loaded. This is common file and is not corrupted, so my question: am I doing something wrong?