Author Topic: Modifyed level indicator for Lazarus  (Read 44 times)

USERPC01

  • Posts: 26
Modifyed level indicator for Lazarus
« on: 10 Aug '18 - 20:23 »
 Modifyed program from  https://stackoverflow.com/questions/...ss-in-delphi-7    with patched type boolean  to LongBool  , works  in the  Lazarus:

// type DWord = LongWord;


program rec;
uses Windows, Bass;
 
(* This function called while recording audio *)
function RecordingCallback(h: HRECORD; b: Pointer; l: DWord; u: Pointer):LongBool; stdcall; 
//function RecordingCallback(h:HRECORD; b:Pointer; l,u: DWord): boolean; stdcall;
 var level:dword;
 begin
  level:=BASS_ChannelGetLevel(h);
  write(''#13,LoWord(level),' -       ', HiWord(level),'         ');
  Result := True;
 end;
 
begin
  BASS_RecordInit(-1);
  BASS_RecordStart(44100, 2, 0, @RecordingCallback, nil);
  Readln;
  BASS_RecordFree;
end.

USERPC01

  • Posts: 26
Re: Modifyed level indicator for Lazarus
« Reply #1 on: 10 Aug '18 - 20:25 »
Add bass.dll and bass.pas from folder delphi into project folder  , create new program in the Lazarus IDE, put hte code into  rec.lpr ,save as  rec.lpr, compile, run .