[fpc-pascal] simple sound implementation

Daniël Mantione daniel.mantione at freepascal.org
Sun Sep 2 13:33:15 CEST 2007



Op Sun, 2 Sep 2007, schreef Marc Santhoff:

> Am Sonntag, den 02.09.2007, 10:32 +0200 schrieb Dani=EBl Mantione:
> > =

> > You can set the bell frequency using write(#27'10;freq') and the durati=
on =

> > using write(#27'10;duration'), where freq is in Hz and duration in =

> > milliseconds. Then ctrl+g to ring the bell. It is possible to play musi=
c =

> > this way.
> =

> Hey, I like control sequences for this task!
> =

> I understand this as controlling the noise a write(#07) makes, pretty
> easy. I'll try it.
> =

> Ahem, maybe you know how to control the volume, too?

In the original IBM PC the speaker was directly connected to the 8254 =

timer chip, therefore there exists no volume control.

In modern PCs, the PC-speaker is often rerouted through the sound card, =

where it can be controlled using the mixer. You use the OSS/ALSA mixer API =

in such case.
 =

Dani=EBl


More information about the fpc-pascal mailing list