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

John vd Waeter john at jvdw.nl
Wed Sep 1 15:38:13 CEST 2010


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.

sri,
John


Peter E Williams wrote:
> Hi Michael and All,
> 
> Actually I don't need a resolution of single milliseconds. I really only
> need tens or even hundreds of milliseconds. Typical MSecs parameter is
> 100ms. Also, exact Tone frequency is not required... only the approx
> frequency tone. Obviously, since I want to create a range of tones then
> creating custom wave files would be overkill.
> 
> The original TBeeper component for Delphi simply beeped the pc speaker
> and used some assembler code, but it was only 26KB of code. It also had
> the ability to play simple tone 'songs' by beeping a range of tone
> frequencies at different durations. These 'songs' were simply ASCII text
> data files. I still have it if you are interested.
> 
> Best Regards,
> 	PEW
> Hobart, Tasmania, Australia
> 
> On Wed, 2010-09-01 at 14:21 +0200, Michael Schnell wrote:
>> You cant get a resolution of milliseconds in a user program.
>>
>> So I would create a wave file that contains the correct "bleep".
>>
>> With Delphi I once used this wave player component: 
>> http://www.un4seen.com/. I don't know if it's been tested with Lazarus 
>> and if something similar can be done on Linux.
>>
>> I used some free tool to create sine and similar waves in wav-files.
>>
>> -Michael
> 


-- 
John vd Waeter
www.jvdw.nl
www.gps-carpool.net
www.shotinthedark.nl
www.pdaforms.nl
www.dbapocket.nl

john at jvdw.nl




More information about the Lazarus mailing list