Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lazarus Pascal beep command

Tags:

pascal

lazarus

I'm running Lazarus on Windows. I would really like to make the program "Beep". It appears that you can do so in Pascal using:

windows.beep(300,500);

But not in Lazarus! Is there another command that I can use?

Update:

sysutils.beep()

This works, but I'd really like to set the frequency and duration of sound

like image 312
16 revs, 12 users 31% Avatar asked Dec 07 '22 01:12

16 revs, 12 users 31%


2 Answers

Afaik this is functionality that worked for ages. (Dev Pascal is over ten years old).

What is different is that Lazarus does not automatically add Windows to the uses clause, like Delphi does.

like image 71
Marco van de Voort Avatar answered Dec 26 '22 03:12

Marco van de Voort


If this function is not declared in Lazarus, you can declare it like:

function Beep(dwFreq, dwDuration: DWORD): BOOL; stdcall; external 'kernel32.dll';
like image 31
VitaliyG Avatar answered Dec 26 '22 02:12

VitaliyG