BASS_GetInfo syntax for Delphist...

Started by fredvs,

fredvs

:D Hi folks.

Is it possile to give me a short example how to use the syntax of BASS_GetInfo wih Delphi, for example to retreive the num of speakers ?

(I like C But i work with Delphi and pointers are very new for me and there is no example in Delphi)...

Thanks  

Ingolf2

I guess:

var
  I: BASS_INFO;
begin
  I.Size := SizeOf(I);
  BASS_GetInfo(I);
end;

or something...

fredvs

#2
Sorry, But what do i with BASS_GetInfo(I)  ?

I have try But the result is a pointer, and i dont know how to transform into a string or integer, or something that i know... :-/

engineeer

#3
try something like this, and look at BASS.CHM for more information...

var info: BASS_INFO;
    latency: Integer;
    latencystr: String;
begin
  BASS_Init(-1,44100, BASS_DEVICE_LATENCY,0);
  info.size:=sizeof(info);
  BASS_GetInfo(info);
  latency:=info.latency; //device latency
  latencystr:='device latency: ' + IntToStr(info.latency) + ' ms';
  BASS_Free();
end;

This gives you your default sound card latency (in millisecond) as Intiger (latency) and String (latencystr).

fredvs

#4
Thanks a lot, it works like charms, i have all what i needed :-*
(I was searching for a sofisticated pointer syntax and it was so simple...)

 :idea: If i have well understand, BASS_GetInfo give the place (the pointer) where reside the var that will contain the result.

 :idea: With BASS, you learn C++ very quick. ;)