mixer=ossaudiodev.openmixer() if mixer.channels() & (1 << ossaudiodev.SOUND_MIXER_PCM): # PCM is supported <code>
For most purposes, the SOUND_MIXER_VOLUME (Master volume) and SOUND_MIXER_PCM channels should suffice--but code that uses the mixer should be flexible when it comes to choosing sound channels. On the Gravis Ultrasound, for example, SOUND_MIXER_VOLUME does not exist.
See the code example for the channels() function for an example of getting data from a bitmask.
(left_volume,right_volume). Volumes are specified as numbers from 0 (silent) to 100 (full volume). If the channel is monophonic, a 2-tuple is still returned, but both channel volumes are the same.
If an unknown channel is specified, error is raised.
|channel, (left, right))|
rightmust 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 IOError if an invalid mixer channel was specified; TypeError if the argument format was incorrect, and error if the specified volumes were out-of-range.
mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)
See About this document... for information on suggesting changes.