Part of my application in Lazarus specifies an event when someone screams.
I'm using Lazarus and have no clue how to simply get mic activity.
I'm trying to use some examples to start from, but having headaches troubleshooting RecordStart declaration:
Incompatible type for arg no. 4: Got "<address of function(LongWord;Pointer;LongWord;LongWord):Boolean;StdCall>", expected "<procedure variable type of function(LongWord;Pointer;LongWord;Pointer):LongBool;StdCall>"
program rec;
uses Windows, Bass;
(* This function called while recording audio *)
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.