PageRenderTime 214ms CodeModel.GetById 110ms app.highlight 2ms RepoModel.GetById 99ms app.codeStats 0ms

#! | 112 lines | 84 code | 28 blank | 0 comment | 0 complexity | 18d1636637f50449eda5e5d15ce27542 MD5 | raw file
  1audiopy - a program to control the Solaris audio device.
  3Contact: Barry Warsaw
  5Version: 1.1
  9    Audiopy is a program to control the Solaris audio device, allowing
 10    you to choose both the input and output devices, and to set the
 11    output volume.  It can be run either as a standalone command-line
 12    script, or as a Tkinter based GUI application.
 14    Note that your version of Python must have been built with the
 15    sunaudiodev module enabled.  It is not enabled by default however!
 16    You will need to edit your Modules/Setup file, uncomment the
 17    sunaudiodev module spec line and rebuild Python.
 19    Using audiopy, you can select one of three possible input devices:
 20    the microphone, the line-in jack, or the CD in.  These choices are
 21    mutually exclusive; you can only have one active input device at
 22    any one time (this is enforced by the underlying device).  Some
 23    input devices may not be supported on all Solaris machines.
 25    You can also choose to enable any of the three possible output
 26    devices: the headphone jack, the speakers, or the line-out jack.
 27    You can enable any combination of these three devices.
 29    You can also set the output gain (volume) level.
 31Running as a GUI
 33    Simply start audiopy with no arguments to start it as a Tkinter
 34    based GUI application.  It will pop up a window with two sections:
 35    the top portion contains three radio buttons indicating your
 36    selected input device; the middle portion contains three
 37    checkboxes indicating your selected output devices; the bottom
 38    portion contains a slider that changes the output gain.
 40    Note the underlined characters in the button labels.  These
 41    indicate keyboard accelerators so that pressing Alt+character you
 42    can select that device.  For example, Alt-s toggles the Speaker
 43    device.  The Alt accelerators are the same as those you'd use in
 44    as the short-form command line switches (see below).
 46    Alt-q is also an accelerator for selecting Quit from the File
 47    menu.
 49    Unsupported devices will appear dimmed out in the GUI.  When run
 50    as a GUI, audiopy monitors the audio device and automatically
 51    updates its display if the state of the device is changed by some
 52    other means.  With Python versions before 1.5.2 this is done by
 53    occasionally polling the device, but in Python 1.5.2 no polling is
 54    necessary (you don't really need to know this, but I thought I'd
 55    plug 1.5.2 :-).
 57Running as a Command Line Program
 59    You can run audiopy from the command line to select any
 60    combination of input or output device, by using the command line
 61    options.  Actually, any option forces audiopy to run as a command
 62    line program and not display its GUI.
 64    Options have the general form
 66        --device[={0,1}]
 67        -d[-{0,1}]
 69    meaning there is both a long-form and short-form of the switch,
 70    where `device' or `d' is one of the following:
 72        (input)
 73            microphone -- m
 74            linein     -- i
 75            cd         -- c
 77        (output)
 78            headphones -- p
 79            speaker    -- s
 80            lineout    -- o
 82    When no value is given, the switch just toggles the specified
 83    device.  With a value, 0 turns the device off and 1 turns the
 84    device on.  Any other value is an error.
 86    For example, to turn the speakers off, turn the headphones on, and 
 87    toggle the cd input device, run audiopy from the command line like 
 88    so:
 90    % ./audiopy -s=0 -p=1 -c
 92    Audiopy understands these other command line options:
 94    --gain volume
 95    -g volume
 96        Sets the output volume to the specified gain level.  This must 
 97        be an integer between MIN_GAIN and MAX_GAIN (usually [0..255], 
 98        but use the -h option to find the exact values).
100    --version
101    -v
102        Print the version number and exit
104    --help
105    -h
106        Print a help message and exit
110Local Variables:
111indent-tabs-mode: nil