[fpc-pascal] simple sound implementation

Daniël Mantione daniel.mantione at freepascal.org
Sun Sep 2 10:32:19 CEST 2007



Op Sun, 2 Sep 2007, schreef Jonas Maebe:

> 
> On 02 Sep 2007, at 07:58, Marc Santhoff wrote:
> 
> > FreeBSD has a simple speaker-device and is able to use it for simple
> > freqency and duration sounds via ioctl as well as playing musical notes
> > a simple acsii-notation. Maybe Linux, MacOS and others have similar
> > possibilities?
> 
> Mac OS X doesn't. Linux doesn't either, afaik (we teach one lab sessions at
> the university where the goal is to write/complete a similar device driver for
> Linux).

You can set the bell frequency using write(#27'10;freq') and the duration 
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 music 
this way.

Of course, the PC-Speaker is not really high fidelty sound.

Daniël


More information about the fpc-pascal mailing list