1998-12-03 12:27:38 -04:00
|
|
|
|
audiopy - a program to control the Solaris audio device.
|
1998-12-03 15:32:38 -04:00
|
|
|
|
|
1998-12-14 17:36:40 -04:00
|
|
|
|
Contact: Barry Warsaw
|
1998-12-03 15:32:38 -04:00
|
|
|
|
Email: bwarsaw@python.org
|
1999-05-01 13:27:23 -03:00
|
|
|
|
Version: 1.0
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
|
|
1999-04-28 16:32:46 -03:00
|
|
|
|
Audiopy is a program to control the Solaris audio device, allowing
|
|
|
|
|
you to choose both the input and output devices, and to set the
|
|
|
|
|
output volume. It can be run either as a standalone command-line
|
|
|
|
|
script, or as a Tkinter based GUI application.
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
Note that your version of Python must have been built with the
|
|
|
|
|
sunaudiodev module enabled. It is not enabled by default however!
|
|
|
|
|
You will need to edit your Modules/Setup file, uncomment the
|
|
|
|
|
sunaudiodev module spec line and rebuild Python.
|
|
|
|
|
|
|
|
|
|
Using audiopy, you can select one of three possible input devices:
|
|
|
|
|
the microphone, the line-in jack, or the CD in. These choices are
|
|
|
|
|
mutually exclusive; you can only have one active input device at
|
|
|
|
|
any one time (this is enforced by the underlying device). Some
|
|
|
|
|
input devices may not be supported on all Solaris machines.
|
|
|
|
|
|
|
|
|
|
You can also choose to enable any of the three possible output
|
|
|
|
|
devices: the headphone jack, the speakers, or the line-out jack.
|
|
|
|
|
You can enable any combination of these three devices.
|
|
|
|
|
|
1999-04-28 16:32:46 -03:00
|
|
|
|
You can also set the output gain (volume) level.
|
|
|
|
|
|
1998-12-03 12:27:38 -04:00
|
|
|
|
Running as a GUI
|
|
|
|
|
|
|
|
|
|
Simply start audiopy with no arguments to start it as a Tkinter
|
1999-05-01 13:27:23 -03:00
|
|
|
|
based GUI application. It will pop up a window with two sections:
|
1998-12-03 12:27:38 -04:00
|
|
|
|
the top portion contains three radio buttons indicating your
|
1999-05-01 13:27:23 -03:00
|
|
|
|
selected input device; the middle portion contains three
|
|
|
|
|
checkboxes indicating your selected output devices; the bottom
|
|
|
|
|
portion contains a slider that changes the output gain.
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
Note the underlined characters in the button labels. These
|
|
|
|
|
indicate keyboard accelerators so that pressing Alt+character you
|
|
|
|
|
can select that device. For example, Alt-s toggles the Speaker
|
1998-12-03 15:32:38 -04:00
|
|
|
|
device. The Alt accelerators are the same as those you'd use in
|
|
|
|
|
as the short-form command line switches (see below).
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
Alt-q is also an accelerator for selecting Quit from the File
|
|
|
|
|
menu.
|
|
|
|
|
|
1999-04-28 16:32:46 -03:00
|
|
|
|
Unsupported devices will appear dimmed out in the GUI. When run
|
|
|
|
|
as a GUI, audiopy monitors the audio device and automatically
|
|
|
|
|
updates its display if the state of the device is changed by some
|
1999-05-01 13:27:23 -03:00
|
|
|
|
other means. With Python versions before 1.5.2 this is done by
|
|
|
|
|
occasionally polling the device, but in Python 1.5.2 no polling is
|
|
|
|
|
necessary (you don't really need to know this, but I thought I'd
|
|
|
|
|
plug 1.5.2 :-).
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
Running as a Command Line Program
|
|
|
|
|
|
|
|
|
|
You can run audiopy from the command line to select any
|
|
|
|
|
combination of input or output device, by using the command line
|
|
|
|
|
options. Actually, any option forces audiopy to run as a command
|
|
|
|
|
line program and not display its GUI.
|
|
|
|
|
|
|
|
|
|
Options have the general form
|
|
|
|
|
|
|
|
|
|
--device[={0,1}]
|
|
|
|
|
-d[-{0,1}]
|
|
|
|
|
|
|
|
|
|
meaning there is both a long-form and short-form of the switch,
|
|
|
|
|
where `device' or `d' is one of the following:
|
|
|
|
|
|
|
|
|
|
(input)
|
|
|
|
|
microphone -- m
|
|
|
|
|
linein -- i
|
|
|
|
|
cd -- c
|
|
|
|
|
|
|
|
|
|
(output)
|
|
|
|
|
headphones -- p
|
|
|
|
|
speaker -- s
|
|
|
|
|
lineout -- o
|
|
|
|
|
|
|
|
|
|
When no value is given, the switch just toggles the specified
|
|
|
|
|
device. With a value, 0 turns the device off and 1 turns the
|
|
|
|
|
device on. Any other value is an error.
|
|
|
|
|
|
|
|
|
|
For example, to turn the speakers off, turn the headphones on, and
|
|
|
|
|
toggle the cd input device, run audiopy from the command line like
|
|
|
|
|
so:
|
|
|
|
|
|
|
|
|
|
% ./audiopy -s=0 -p=1 -c
|
|
|
|
|
|
1999-04-28 16:32:46 -03:00
|
|
|
|
Audiopy understands these other command line options:
|
|
|
|
|
|
|
|
|
|
--gain volume
|
|
|
|
|
-g volume
|
|
|
|
|
Sets the output volume to the specified gain level. This must
|
|
|
|
|
be an integer between MIN_GAIN and MAX_GAIN (usually [0..255],
|
|
|
|
|
but use the -h option to find the exact values).
|
1998-12-03 12:27:38 -04:00
|
|
|
|
|
|
|
|
|
--version
|
|
|
|
|
-v
|
|
|
|
|
Print the version number and exit
|
|
|
|
|
|
|
|
|
|
--help
|
|
|
|
|
-h
|
|
|
|
|
Print a help message and exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
|
End:
|