[fpc-pascal] simple sound implementation
daniel.mantione at freepascal.org
Sun Sep 2 19:30:43 CEST 2007
Op Sun, 2 Sep 2007, schreef Mark Wood:
> > 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)
If you run as root, acquire I/O port access and run SCHED_FIFO (so you are
not pre-empted), it might work.
However, as nowadays all PCs have a 16 bit audio possibility I don't see a
reason to do such ugly tricks with the PC speaker.
More information about the fpc-pascal