[Lazarus] How to produce a tone at Tone frequency for duration MSecs (milliseconds)

Sven Barth pascaldragon at googlemail.com
Thu Sep 2 17:32:48 CEST 2010

Am 02.09.2010 17:05, schrieb Henry Vermaak:
> On 2 September 2010 15:42, Henry Vermaak<henry.vermaak at gmail.com>  wrote:
>> On 2 September 2010 14:47, Sven Barth<pascaldragon at googlemail.com>  wrote:
>>> Am 02.09.2010 13:02, schrieb Henry Vermaak:
>>>> On 02/09/10 10:39, Peter E Williams wrote:
>>>>> On Wed, 01 Sep 2010 15:38:13 +0200 John vd Waeter<john at jvdw.nl>  wrote:
>>>>>> Lol, I wrote something like that years ago... but in these days it was
>>>>>> allowed to address the speaker hardware...
>>>>>> Windows.Beep(freq,duration) does about the same, but afaik it is not
>>>>>> implemented in Lazarus.
>>>>> At the risk of asking a silly question. Why has no-one ported the
>>>>> Windows.Beep procedure to Lazarus. Surely it is not too hard ?!?
>>>> It's not fool proof, but it's not too hard. See here:
>>>> http://github.com/johnath/beep/blob/master/beep.c
>>>> Henry
>>> It's not only not fool proof, but beep also requires to be run as root,
>>> because a normal user can't open /dev/console with write access.
>> http://github.com/johnath/beep/blob/master/README#L25
> Sorry, sent by mistake.  I meant to add that Debian's beep is setuid
> to get around this (information in readme).

It might be the case on Debian, but it might not be on other distros and 
is for sure not on ArchLinux.

Also, if you want beeps in your own program you either need to
- implement beep.c in Pascal (con: you have the same troubles as beep, 
mentioned in the link you sent)
- use beep with TProcess (con: beep must be installed or included with 
your app and also needs to be set up correctly)


More information about the Lazarus mailing list