e.g something like this
// onformcreate
// check the correct BASS was loaded
If (HiWord(BASS_GetVersion()) <> BASSVERSION) then
begin
application.MessageBox
('An incorrect version of BASS.DLL was loaded (2.4 is required)',
'Incorrect BASS.DLL', MB_ICONERROR or MB_OK);
application.Terminate;
end;
// check the correct BASS_FX was loaded
If (HiWord(BASS_FX_GetVersion()) <> BASSVERSION) then
begin
application.MessageBox
('An incorrect version of BASS_FX.DLL was loaded (2.4 is required)',
'Incorrect BASS_FX.DLL', MB_ICONERROR or MB_OK);
application.Terminate;
end;
// setup output - default device, 44100hz, stereo, 16 bits
If BASS_Init(-1, 44100, 0, frmTempo.handle, nil) = false then
begin
Error('Couldnt Initialize Digital Output');
application.Terminate;
end;
//
// load audiofile
chan := BASS_StreamCreateFile(false, PChar(od.Filename), 0, 0, BASS_STREAM_DECODE or BASS_Unicode);
if chan <> 0 then
chan := BASS_FX_TempoCreate(chan, BASS_SAMPLE_LOOP or BASS_FX_FREESOURCE);
ontrackbar change // trackbar has minmax values -30 +30
BASS_ChannelSetAttribute(chan, BASS_ATTRIB_TEMPO_PITCH, fTrackbar.position);