beeping under linux

John Benson jsbenson at bensonsystems.com
Wed Nov 19 16:58:16 EST 2003


Re:
------------------------------
Date: 19 Nov 2003 19:41:28 +0000
From: Alexander Schmolck <a.schmolck at gmx.net>
Subject: beeping under linux
To: python-list at python.org
Message-ID: <yfsk75wgn87.fsf at black132.ex.ac.uk>
Content-Type: text/plain; charset=us-ascii

This is only partly a python question, but what is the easiest way to get
python to (reliably) beep under linux? By reliably I mean that ``print
"\b"``
won't do because it depends on the terminal settings -- so I guess I'm
looking
for some simple way to more or less directly access the internal speaker
(maybe writing to something in /dev/).

[The usage scenario is simply to have an effective way of signalling that a
long running-process finshed, without me having to constantly look at the
screen]

'as
------------------------------

How about playing a sound using a system() command?

I had a similar problem about twenty years ago, and hooked my Commodore 64
up via a serial adapter to the extension port on the Tandem (minicomputer)
terminal's auxiliary port. When a long-running compile finished, a script
wrote a special string out to the terminal which was watched for by the
C-64. Then the C-64 used his speech synthesizer to say something. I found
that by passing special strings to the synthesizer, I could get a "Max
Headroom", "T-t-t-t-talking 'bout my generation" or Porky Pig effect. None
of my co-workers liked it, so it was used mostly at night.

Another time I was using Tandy T-100 4-line LCD laptops  which had a
cassette start/stop switch port. I got a long-running sound effect of a
crowd booing and hissing, left it in the cassette player controlled by a
wire from the start/stop port and played the tape for a few seconds whenever
the operator made a mistake. This was roughly about the time that the
Macintosh appeared and took user interface in a completely different
direction. I'm thinking of taking out a patent anyway, you never know.

To cap this off, a major aerospace defense contractor I worked for had
rigged up an ascii switch connected to the Tandem computer that ran part of
their factory. A process on the Tandem polled the OS to verify that certain
critical components were up, and if any weren't, it printed a string out to
the ascii switch which detected the string and activated something like a
foghorn. The programmers were conditioned to respond to the foghorn with
immediate sprinting for the machine room, which was disconcerting the first
time I experienced it.

A less-invasive way to get your attention might be to use a GUI toolkit to
put up a big, empty window and flash it light and dark.







More information about the Python-list mailing list