ossaudiodev.oss_mixer_device.controls()

oss_mixer_device.controls() This method returns a bitmask specifying the available mixer controls (“Control” being a specific mixable “channel”, such as SOUND_MIXER_PCM or SOUND_MIXER_SYNTH). This bitmask indicates a subset of all available mixer controls—the SOUND_MIXER_* constants defined at module level. To determine if, for example, the current mixer object supports a PCM mixer, use the following Python code: mixer=ossaudiodev.openmixer() if mixer.controls() & (1 << ossaudiodev

ossaudiodev.oss_mixer_device.close()

oss_mixer_device.close() This method closes the open mixer device file. Any further attempts to use the mixer after this file is closed will raise an OSError.

ossaudiodev.oss_audio_device.writeall()

oss_audio_device.writeall(data) Write a bytes-like object data to the audio device: waits until the audio device is able to accept data, writes as much data as it will accept, and repeats until data has been completely written. If the device is in blocking mode (the default), this has the same effect as write(); writeall() is only useful in non-blocking mode. Has no return value, since the amount of data written is always equal to the amount of data supplied. Changed in version 3.5: Writabl

ossaudiodev.oss_audio_device.write()

oss_audio_device.write(data) Write a bytes-like object data to the audio device and return the number of bytes written. If the audio device is in blocking mode (the default), the entire data is always written (again, this is different from usual Unix device semantics). If the device is in non-blocking mode, some data may not be written —see writeall(). Changed in version 3.5: Writable bytes-like object is now accepted.

ossaudiodev.oss_audio_device.sync()

oss_audio_device.sync() Wait until the sound device has played every byte in its buffer. (This happens implicitly when the device is closed.) The OSS documentation recommends closing and re-opening the device rather than using sync().

ossaudiodev.oss_audio_device.speed()

oss_audio_device.speed(samplerate) Try to set the audio sampling rate to samplerate samples per second. Returns the rate actually set. Most sound devices don’t support arbitrary sampling rates. Common rates are: Rate Description 8000 default rate for /dev/audio 11025 speech recording 22050 44100 CD quality audio (at 16 bits/sample and 2 channels) 96000 DVD quality audio (at 24 bits/sample)

ossaudiodev.oss_audio_device.setparameters()

oss_audio_device.setparameters(format, nchannels, samplerate[, strict=False]) Set the key audio sampling parameters—sample format, number of channels, and sampling rate—in one method call. format, nchannels, and samplerate should be as specified in the setfmt(), channels(), and speed() methods. If strict is true, setparameters() checks to see if each parameter was actually set to the requested value, and raises OSSAudioError if not. Returns a tuple (format, nchannels, samplerate) indicating

ossaudiodev.oss_audio_device.setfmt()

oss_audio_device.setfmt(format) Try to set the current audio format to format—see getfmts() for a list. Returns the audio format that the device was set to, which may not be the requested format. May also be used to return the current audio format—do this by passing an “audio format” of AFMT_QUERY.

ossaudiodev.oss_audio_device.reset()

oss_audio_device.reset() Immediately stop playing or recording and return the device to a state where it can accept commands. The OSS documentation recommends closing and re-opening the device after calling reset().

ossaudiodev.oss_audio_device.read()

oss_audio_device.read(size) Read size bytes from the audio input and return them as a Python string. Unlike most Unix device drivers, OSS audio devices in blocking mode (the default) will block read() until the entire requested amount of data is available.