The mixer object provides two file-like methods:
) |
) |
The remaining methods are specific to audio mixing:
) |
mixer=ossaudiodev.openmixer() if mixer.controls() & (1 << ossaudiodev.SOUND_MIXER_PCM): # PCM is supported ... code ...
For most purposes, the SOUND_MIXER_VOLUME (master volume) and SOUND_MIXER_PCM controls should suffice--but code that uses the mixer should be flexible when it comes to choosing mixer controls. On the Gravis Ultrasound, for example, SOUND_MIXER_VOLUME does not exist.
) |
See the code example for the controls() function for an example of getting data from a bitmask.
) |
control) |
(left_volume,right_volume)
. Volumes are specified as
numbers from 0 (silent) to 100 (full volume). If the control is
monophonic, a 2-tuple is still returned, but both volumes are
the same.
Raises OSSAudioError if an invalid control was is specified, or IOError if an unsupported control is specified.
control, (left, right)) |
(left,right)
.
left
and right
must be ints and between 0 (silent) and 100
(full volume). On success, the new volume is returned as a 2-tuple.
Note that this may not be exactly the same as the volume specified,
because of the limited resolution of some soundcard's mixers.
Raises OSSAudioError if an invalid mixer control was specified, or if the specified volumes were out-of-range.
) |
bitmask) |
mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)
See About this document... for information on suggesting changes.