private
{ Private declarations }
mods: array[0..128] of HMUSIC;
modc: Integer;
sams: array[0..128] of HSAMPLE;
samc: Integer;
str: HSTREAM;
procedure Play;
f := PChar(ListBox1.Items.Strings[ListBox1.Itemindex]);
str := BASS_StreamCreateFile(FALSE, f, 0, 0, 0);
// Play stream, not flushed
if not BASS_StreamPlay(str, FALSE, 0) then
Error('Can''t play stream');
procedure TForm1.FormCreate(Sender: TObject);
begin
modc := 0; // music module count
samc := 0; // sample count
str := 0; // stream count
// Ensure BASS 2.0 was loaded
if BASS_GetVersion() <> MAKELONG(2,0) then begin
Error('BASS version 2.0 was not loaded!');
Halt;
end;
// Initialize audio - default device, 44100hz, stereo, 16 bits
if not BASS_Init(1, 44100, 0,
Handle, nil) then
Error('Error initializing audio!');
end;