5
Based on documentation from Bass, i am trying to upload a common 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 which according to the documentation, is an error in the Handle, in this case, in my variable music
. If I comment on these lines below BASS_SampleLoad
, the code changes to 2, which means the file cannot be loaded. This is ordinary file and it is not corrupted so my question: I am doing something wrong?
I think only one link to what BASS is or its documentation is missing. At least for those who do not know, it would be difficult to help.
– EMBarbosa
@Embarrassment: That’s why I added the link in my reply
– whosrdaddy
@whosrdaddy I noticed. I just thought I should be on the question instead of being on the answer. Anyway, good job on detecting the problem.
– EMBarbosa