[fpc-pascal]Beep in Linux

A.J. Venter ddt at vukanet.co.za
Wed Jul 3 11:55:03 CEST 2002


> >All that said there is another option - asuming you do not considder the
> > use of the speaker vital, but can settle on a soundcard. Almost every
> > distribution includes a commandline mp3 and wav player and most also
> > include oggvorbis support.
>
> These are too many assumptions for my taste :)
>
True,
However you do not need to make assumptions by need, soundcards are now almost standard equipment so that one is 
relatively safe, as for the rest the simple way around it is to use create an install script for your program to configure it.

You could write a makefile for this, or use a shell script, the latter having the advantage that it can be coupled with most package  managers
such as deb or rpm.

In bash the script could be something like:

#!/bin/bash

echo "Installing binaries:"
echo -n "Directory to install to:"
read INSTALLDIR
cp myapp $INSTALLDIR
...
echo "Configuring program"
echo -n "What sound format would you like [mp3,ogg,wav] :"
read SOUNDFORMAT
echo  -n "Where do you want the sound file installed ?"
READ SOUNDDIR
mv mysoundfile.$SOUNDFORMAT SOUNDDIR
echo -n "Type the commandline for play $SOUNDFORMAT files:"
read SOUNDCMD
echo "Creating configuration file /etc/myapp.conf"
echo "$SOUNDCMD" > /etc/myapp.conf
echo "$SOUNDFORMAT" >> /etc/myapp.conf

echo "All done"

Then you merely read the two lines in /etc/myapp.conf into two strings and do:
shell (sound_command + ' mysoundfile.' + soundformat);

Thus is my suggestion, I hope it is helpful, if not perhaps it may be at some time in the future.

Ciao
A.J. Venter




More information about the fpc-pascal mailing list