Newsgroups: gmane.linux.debian.user Date: Thu, 3 Aug 2006 16:21:01 +0200
> I want to generate beeping sounds in a program.
I'm not sure I understand what you want to do, but it sounds like you want to playback digital audio samples.
If so, what you probably want is something like libao2 and libao-dev.
CJ van den Berg
> No, I don't want to play back anything: I want to *generate* a beeping > sound. The type depends upon the occasion.
So you actually want to synthesize the beep? Is that right?
If you really do want just a beep you could synthesize the sine wave yourself pretty easily. The one and only source code example in the libao coincidentally does exactly that.
http://www.xiph.org/ao/doc/ao_example.c
> Right now I use Nas, which has good support from Jon Trulson. But that > is meant really as a network sound server and not made for playing back > to a particular sound card.
The libao alsa driver (alsa09), which I assume you would be using, allows you to specify which device (ie. sound card) you want to use. The oss driver will too.
> E.g. if it is 11:30 I want to produce 5 beeps for maritime chimes. If > the dialup line goes down I want to produce 9 beeps. > > I would prefer to produce the beeps for a particular soundcard, for the > user that is logged on to a monotor that uses that card.
A few lines of tweaking to that example I linked above should do exactly what you want.
CJ van den Berg
> > No, I don't want to play back anything: I want to *generate* a beeping > > sound. The type depends upon the occasion.
I missed the original message, but how about the beep package?
andrew@basement:~$ apt-cache show beep Package: beep Priority: optional Section: sound
Description: advanced pc-speaker beeper
beep does what you'd expect: it beeps. But unlike printf "\a" beep allows you to control pitch, duration, and repetitions. Its job is to live inside shell/perl scripts and allow more granularity than one has otherwise. It is controlled completely through command line options. It's not supposed to be complex, and it isn't - but it makes system monitoring (or whatever else it gets hacked into) much more informative.
Tag: interface::commandline, made-of::lang:c, role::sw:utility, works-with::audio
Andrew Sackville-West