1. Download the archives for Android and Windows from the BASS site.
2.
a) For Delphi 10.3.3, open the bass.pas file from the Windows archive. Instead of AnsiChar we write Byte, place PAnsiChar we write MarshaledAString.
b) For C ++ Builder 10.3.3, open bass.h and comment on the declaration
// typedef uint32_t DWORD;
c) Include these files in the uses / include project.
3. Add SO files from the armeabi / armeabi-v7a / arm64-v8a folders to the project Deployment and specify the Remote path in the Deployment (library \ lib \ armeabi-v7a and others).
4. In the project options, add the path to the arm64-v8a folder in the Seach Path.
I try use Delphi 64bit because I want publish app in Google Play Market.
Code: Select all
var
Form1: TForm1;
smp: HSAMPLE;
str: HSTREAM;
implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
var
M: TMarshaller;
begin
BASS_StreamFree(str);
str := BASS_StreamCreateURL(M.AsAnsi('http://91.199.194.34:8000').ToPointer, 0, 0, nil, nil);
BASS_SetVolume(TrackBar1.Value/100.0);
BASS_ChannelPlay(str, True);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
BASS_ChannelStop(str);
BASS_SampleFree (smp);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TrackBar1.Value := 10;
if not BASS_Init(-1, 44100, 0, nil, nil) then
ShowMessage('Error initializing audio!');
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
BASS_SetVolume(TrackBar1.Value/100.0);
end;
