[fpc-pascal] simple sound implementation
luca at ventoso.org
Sun Sep 2 19:46:18 CEST 2007
En/na Marco van de Voort ha escrit:
>>> Naturally, this is not possible: The PC speaker is simply controlled
>>> by a timer, which creates a square wave (on/off). In ancient DOS times
>>> there was a trick by doing a frequency modulation, i.e. you turn the
>>> timer on and off quite fast. But on Linux etc. the drivers don't
>>> support such cheats.
>> <scratches chin> Hmmm... could you use that old Turbo Pascal code to do
>> an inline of the ASM for it? (talking completely through my hat having
>> never attempted such a thing on a linux platform)
> Not really. It is not the asm or not, it is simply no hardware access from
> programs in principle, one program not being able to lock the entire CPU to
> modulate the speaker.
> Of course you can, but then you go into the realm of customizing linux.
There's also the "pc-speaker" driver (though I never used it) that
already does it:
More information about the fpc-pascal