Next. I was using the bass.dll without any problem. However when I try to use the attributes of bass_fx.dll, bass does not recognize it. I performed the installation of the two dlls as follows.
1- Copy the dlls to the exe folder.
2- I added to the project the respective units duly updated, recently downloaded from the un4seen site.
Follow the code:
program BassFXTest;
uses
Vcl.Forms,
Vcl.Dialogs,
SysUtils,
Variants,
bass in 'Bass\bass.pas',
bass_fx in 'Bass\bass_fx.pas';
var
Form : TForm;
Channel : HChannel;
Sample : HSample;
Filename : PChar;
begin
Application.Initialize;
filename := PChar('sample.ogg');
Application.MainFormOnTaskBar := true;
Application.CreateForm(TForm, Form);
if not Bass_Init(-1, 44100, 0, 0, nil) then
ShowMessage('Error initing (' + IntToStr(Bass_ErrorGetCode) + ').');
Sample := Bass_SampleLoad(false, filename, 0, 0, 1000, BASS_UNICODE);
if Sample = 0 then
ShowMessage('Error loading sample (' + IntToStr(Bass_ErrorGetCode) + ').');
Channel := Bass_SampleGetChannel(Sample, false);
if Channel = 0 then
ShowMessage('Error creating Channel (' + IntToStr(Bass_ErrorGetCode) + ').');
if not BASS_ChannelSetAttribute(Channel, BASS_ATTRIB_VOL, 1) then
ShowMessage('Error VOL (' + IntToStr(Bass_ErrorGetCode) + ').');
if not BASS_ChannelSetAttribute(Channel, BASS_ATTRIB_TEMPO_PITCH, 3) then
ShowMessage('Error PITCH (' + IntToStr(Bass_ErrorGetCode) + ').');
if not BASS_ChannelPlay(Channel, True) then
ShowMessage('Error Playing Channel (' + IntToStr(Bass_ErrorGetCode) + ').');
Application.Run;
end.
The code above reproduces the sample but does not recognize the BASS_ATTRIB_TEMPO_PITCH
attribute; it only displays the "PITCH (19) error."; error that according to the documentation of the bass means that the attribute does not exist. But according to the bass_fx documentation, this attribute is correct. Where could the mistake be? Is it that I'm installing bass_fx the wrong way?