Currently, after recording audio using pyalsaaudio, the client is unable to close the device.
The reason is that PulseAudio client tries to drain the pipe to the PulseAudio server (presumably in order to prevent Broken Pipe error) on closing. That will never finish since new data will always arrive in the pipe.
Worse, the __del__ handler was auto-closing and thus auto-hanging.
Therefore, pause before de-allocating.
SND_PCM_FORMAT_S24_LE and similar are for 24bit ints packed in 4-bytes each.
There is a similar family of formats for 3-bytes packed data (as stored in 24bit wave files).
This commit:
- adds S24_3LE, S24_3BE, U24_3LE, U24_3BE PCM formats to the alsaaudio.c
- updates documentation
- updates playwav.py to correctly play typical 24Bit PCM wave files
Closes#38
The cards() method does not guarantee that the index in its return
value is the same as the actual card index. Provide a way to get this
information in the form of a card_indexes() function, returning a
list of available card indexes.
Add another method, card_name(), which, given a card index, returns
the short and long names of that card.
Add a method, setenum(), for setting the value of an enumerated mixer
element. The argument is an integer index into the list of possible
values returned by getenum().
- Avoid internal re-opening of PCM objects when parameters change.
- PCM objects can be opened by card id
- Mixer objects can be openend by card index
(this is not consistent, but ALSA works this way)
- Adjusted and cleaned up documentation.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@26 ec2f30ec-7544-0410-870e-f70ca00c83f0
should be as backwards compatible as release 0.3 was, but we do have
nicer docstrings in later versions of Python.
setup.py is an executable.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@22 ec2f30ec-7544-0410-870e-f70ca00c83f0
To make this work better, I have removed tp_getattr in favor of tp_getattro
and tp_methods.
This method has much better support for inline help, but relies on
PyObject_GenericGetAttr.
From trawling through the python branches, it looks as if
PyObject_GenericGetAttr was introduced in Python 2.2.
I think it is an acceptable to trade better inline documentation with no
support for versions earlier than 2.2.
(I *could* do both, but my time is finite).
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@20 ec2f30ec-7544-0410-870e-f70ca00c83f0