mirror of
https://github.com/larsimmisch/pyalsaaudio.git
synced 2026-06-01 10:57:01 +00:00
unify line spacing in .rst files
one empty line, except for high-level sections, which get two. while at it, trim whitespace on otherwise empty lines.
This commit is contained in:
+1
-3
@@ -13,15 +13,13 @@ Download
|
|||||||
========
|
========
|
||||||
|
|
||||||
* `Download from pypi <https://pypi.python.org/pypi/pyalsaaudio>`_
|
* `Download from pypi <https://pypi.python.org/pypi/pyalsaaudio>`_
|
||||||
|
|
||||||
|
|
||||||
Github
|
Github
|
||||||
======
|
======
|
||||||
|
|
||||||
* `Repository <https://github.com/larsimmisch/pyalsaaudio/>`_
|
* `Repository <https://github.com/larsimmisch/pyalsaaudio/>`_
|
||||||
* `Bug tracker <https://github.com/larsimmisch/pyalsaaudio/issues>`_
|
* `Bug tracker <https://github.com/larsimmisch/pyalsaaudio/issues>`_
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
|||||||
+17
-32
@@ -13,7 +13,7 @@ The :mod:`alsaaudio` module defines functions and classes for using ALSA.
|
|||||||
.. function:: pcms(pcmtype=PCM_PLAYBACK)
|
.. function:: pcms(pcmtype=PCM_PLAYBACK)
|
||||||
|
|
||||||
List available PCM devices by name.
|
List available PCM devices by name.
|
||||||
|
|
||||||
Arguments are:
|
Arguments are:
|
||||||
|
|
||||||
* *pcmtype* - can be either :const:`PCM_CAPTURE` or :const:`PCM_PLAYBACK`
|
* *pcmtype* - can be either :const:`PCM_CAPTURE` or :const:`PCM_PLAYBACK`
|
||||||
@@ -39,7 +39,7 @@ The :mod:`alsaaudio` module defines functions and classes for using ALSA.
|
|||||||
List the available ALSA cards by name. This function is only moderately
|
List the available ALSA cards by name. This function is only moderately
|
||||||
useful. If you want to see a list of available PCM devices, use :func:`pcms`
|
useful. If you want to see a list of available PCM devices, use :func:`pcms`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
.. function:: mixers(cardindex=-1, device='default')
|
.. function:: mixers(cardindex=-1, device='default')
|
||||||
|
|
||||||
List the available mixers. The arguments are:
|
List the available mixers. The arguments are:
|
||||||
@@ -54,7 +54,7 @@ The :mod:`alsaaudio` module defines functions and classes for using ALSA.
|
|||||||
|
|
||||||
**Note:** For a list of available controls, you can also use ``amixer`` on
|
**Note:** For a list of available controls, you can also use ``amixer`` on
|
||||||
the commandline::
|
the commandline::
|
||||||
|
|
||||||
$ amixer
|
$ amixer
|
||||||
|
|
||||||
To elaborate the example, calling :func:`mixers` with the argument
|
To elaborate the example, calling :func:`mixers` with the argument
|
||||||
@@ -68,7 +68,7 @@ The :mod:`alsaaudio` module defines functions and classes for using ALSA.
|
|||||||
$ amixer -D foo
|
$ amixer -D foo
|
||||||
|
|
||||||
*Changed in 0.8*:
|
*Changed in 0.8*:
|
||||||
|
|
||||||
- The keyword argument `device` is new and can be used to
|
- The keyword argument `device` is new and can be used to
|
||||||
select virtual devices. As a result, the default behaviour has subtly
|
select virtual devices. As a result, the default behaviour has subtly
|
||||||
changed. Since 0.8, this functions returns the mixers for the default
|
changed. Since 0.8, this functions returns the mixers for the default
|
||||||
@@ -78,6 +78,7 @@ The :mod:`alsaaudio` module defines functions and classes for using ALSA.
|
|||||||
|
|
||||||
Return a Python string containing the ALSA version found.
|
Return a Python string containing the ALSA version found.
|
||||||
|
|
||||||
|
|
||||||
.. _pcm-objects:
|
.. _pcm-objects:
|
||||||
|
|
||||||
PCM Objects
|
PCM Objects
|
||||||
@@ -100,7 +101,7 @@ following arguments:
|
|||||||
* *channels* - the number of channels. The default value is 2 (stereo).
|
* *channels* - the number of channels. The default value is 2 (stereo).
|
||||||
* *format* - the data format. This controls how the PCM device interprets data for playback, and how data is encoded in captures.
|
* *format* - the data format. This controls how the PCM device interprets data for playback, and how data is encoded in captures.
|
||||||
The default value is :const:`PCM_FORMAT_S16_LE`.
|
The default value is :const:`PCM_FORMAT_S16_LE`.
|
||||||
|
|
||||||
========================= ===============
|
========================= ===============
|
||||||
Format Description
|
Format Description
|
||||||
========================= ===============
|
========================= ===============
|
||||||
@@ -149,7 +150,7 @@ following arguments:
|
|||||||
- Added the optional named parameters `rate`, `channels`, `format` and `periodsize`.
|
- Added the optional named parameters `rate`, `channels`, `format` and `periodsize`.
|
||||||
|
|
||||||
*Changed in 0.8:*
|
*Changed in 0.8:*
|
||||||
|
|
||||||
- The `card` keyword argument is still supported,
|
- The `card` keyword argument is still supported,
|
||||||
but deprecated. Please use `device` instead.
|
but deprecated. Please use `device` instead.
|
||||||
|
|
||||||
@@ -157,8 +158,7 @@ following arguments:
|
|||||||
|
|
||||||
The `card` keyword is deprecated because it guesses the real ALSA
|
The `card` keyword is deprecated because it guesses the real ALSA
|
||||||
name of the card. This was always fragile and broke some legitimate usecases.
|
name of the card. This was always fragile and broke some legitimate usecases.
|
||||||
|
|
||||||
|
|
||||||
PCM objects have the following methods:
|
PCM objects have the following methods:
|
||||||
|
|
||||||
.. method:: PCM.info()
|
.. method:: PCM.info()
|
||||||
@@ -212,13 +212,11 @@ PCM objects have the following methods:
|
|||||||
Returns the type of PCM object. Either :const:`PCM_CAPTURE` or
|
Returns the type of PCM object. Either :const:`PCM_CAPTURE` or
|
||||||
:const:`PCM_PLAYBACK`.
|
:const:`PCM_PLAYBACK`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: PCM.pcmmode()
|
.. method:: PCM.pcmmode()
|
||||||
|
|
||||||
Return the mode of the PCM object. One of :const:`PCM_NONBLOCK`,
|
Return the mode of the PCM object. One of :const:`PCM_NONBLOCK`,
|
||||||
:const:`PCM_ASYNC`, or :const:`PCM_NORMAL`
|
:const:`PCM_ASYNC`, or :const:`PCM_NORMAL`
|
||||||
|
|
||||||
|
|
||||||
.. method:: PCM.cardname()
|
.. method:: PCM.cardname()
|
||||||
|
|
||||||
Return the name of the sound card used by this PCM object.
|
Return the name of the sound card used by this PCM object.
|
||||||
@@ -232,7 +230,7 @@ PCM objects have the following methods:
|
|||||||
.. deprecated:: 0.9 Use the `rate` named argument to :func:`PCM`.
|
.. deprecated:: 0.9 Use the `rate` named argument to :func:`PCM`.
|
||||||
|
|
||||||
.. method:: PCM.setformat(format)
|
.. method:: PCM.setformat(format)
|
||||||
|
|
||||||
.. deprecated:: 0.9 Use the `format` named argument to :func:`PCM`.
|
.. deprecated:: 0.9 Use the `format` named argument to :func:`PCM`.
|
||||||
|
|
||||||
.. method:: PCM.setperiodsize(period)
|
.. method:: PCM.setperiodsize(period)
|
||||||
@@ -271,13 +269,11 @@ PCM objects have the following methods:
|
|||||||
return value of zero, if the buffer is full. In this case, the data
|
return value of zero, if the buffer is full. In this case, the data
|
||||||
should be written at a later time.
|
should be written at a later time.
|
||||||
|
|
||||||
|
|
||||||
.. method:: PCM.pause([enable=True])
|
.. method:: PCM.pause([enable=True])
|
||||||
|
|
||||||
If *enable* is :const:`True`, playback or capture is paused.
|
If *enable* is :const:`True`, playback or capture is paused.
|
||||||
Otherwise, playback/capture is resumed.
|
Otherwise, playback/capture is resumed.
|
||||||
|
|
||||||
|
|
||||||
.. method:: PCM.polldescriptors()
|
.. method:: PCM.polldescriptors()
|
||||||
|
|
||||||
Returns a tuple of *(file descriptor, eventmask)* that can be used to
|
Returns a tuple of *(file descriptor, eventmask)* that can be used to
|
||||||
@@ -324,7 +320,7 @@ PCM objects have the following methods:
|
|||||||
``PCM_TSTAMP_TYPE_MONOTONIC_RAW`` Monotonic time from an unspecified starting
|
``PCM_TSTAMP_TYPE_MONOTONIC_RAW`` Monotonic time from an unspecified starting
|
||||||
time using only the system clock.
|
time using only the system clock.
|
||||||
================================= ===========================================
|
================================= ===========================================
|
||||||
|
|
||||||
The timestamp mode is controlled by the tstamp_mode, as described in the table below.
|
The timestamp mode is controlled by the tstamp_mode, as described in the table below.
|
||||||
|
|
||||||
================================= ===========================================
|
================================= ===========================================
|
||||||
@@ -335,7 +331,6 @@ PCM objects have the following methods:
|
|||||||
update.
|
update.
|
||||||
================================= ===========================================
|
================================= ===========================================
|
||||||
|
|
||||||
|
|
||||||
**A few hints on using PCM devices for playback**
|
**A few hints on using PCM devices for playback**
|
||||||
|
|
||||||
The most common reason for problems with playback of PCM audio is that writes
|
The most common reason for problems with playback of PCM audio is that writes
|
||||||
@@ -371,11 +366,10 @@ Mixer Objects
|
|||||||
|
|
||||||
Mixer objects provides access to the ALSA mixer API.
|
Mixer objects provides access to the ALSA mixer API.
|
||||||
|
|
||||||
|
|
||||||
.. class:: Mixer(control='Master', id=0, cardindex=-1, device='default')
|
.. class:: Mixer(control='Master', id=0, cardindex=-1, device='default')
|
||||||
|
|
||||||
Arguments are:
|
Arguments are:
|
||||||
|
|
||||||
* *control* - specifies which control to manipulate using this mixer
|
* *control* - specifies which control to manipulate using this mixer
|
||||||
object. The list of available controls can be found with the
|
object. The list of available controls can be found with the
|
||||||
:mod:`alsaaudio`.\ :func:`mixers` function. The default value is
|
:mod:`alsaaudio`.\ :func:`mixers` function. The default value is
|
||||||
@@ -391,30 +385,27 @@ Mixer objects provides access to the ALSA mixer API.
|
|||||||
|
|
||||||
* *device* - the name of the device on which the mixer resides. The default
|
* *device* - the name of the device on which the mixer resides. The default
|
||||||
value is ``'default'``.
|
value is ``'default'``.
|
||||||
|
|
||||||
*Changed in 0.8*:
|
*Changed in 0.8*:
|
||||||
|
|
||||||
- The keyword argument `device` is new and can be used to select virtual
|
- The keyword argument `device` is new and can be used to select virtual
|
||||||
devices.
|
devices.
|
||||||
|
|
||||||
Mixer objects have the following methods:
|
Mixer objects have the following methods:
|
||||||
|
|
||||||
.. method:: Mixer.cardname()
|
.. method:: Mixer.cardname()
|
||||||
|
|
||||||
Return the name of the sound card used by this Mixer object
|
Return the name of the sound card used by this Mixer object
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.mixer()
|
.. method:: Mixer.mixer()
|
||||||
|
|
||||||
Return the name of the specific mixer controlled by this object, For example
|
Return the name of the specific mixer controlled by this object, For example
|
||||||
``'Master'`` or ``'PCM'``
|
``'Master'`` or ``'PCM'``
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.mixerid()
|
.. method:: Mixer.mixerid()
|
||||||
|
|
||||||
Return the ID of the ALSA mixer controlled by this object.
|
Return the ID of the ALSA mixer controlled by this object.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.switchcap()
|
.. method:: Mixer.switchcap()
|
||||||
|
|
||||||
Returns a list of the switches which are defined by this specific mixer.
|
Returns a list of the switches which are defined by this specific mixer.
|
||||||
@@ -435,7 +426,6 @@ Mixer objects have the following methods:
|
|||||||
To manipulate these switches use the :meth:`setrec` or
|
To manipulate these switches use the :meth:`setrec` or
|
||||||
:meth:`setmute` methods
|
:meth:`setmute` methods
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.volumecap()
|
.. method:: Mixer.volumecap()
|
||||||
|
|
||||||
Returns a list of the volume control capabilities of this
|
Returns a list of the volume control capabilities of this
|
||||||
@@ -451,7 +441,7 @@ Mixer objects have the following methods:
|
|||||||
'Capture Volume' Manipulate sound capture volume
|
'Capture Volume' Manipulate sound capture volume
|
||||||
'Joined Capture Volume' Manipulate sound capture volume for all channels at a time
|
'Joined Capture Volume' Manipulate sound capture volume for all channels at a time
|
||||||
======================== ================
|
======================== ================
|
||||||
|
|
||||||
.. method:: Mixer.getenum()
|
.. method:: Mixer.getenum()
|
||||||
|
|
||||||
For enumerated controls, return the currently selected item and the list of
|
For enumerated controls, return the currently selected item and the list of
|
||||||
@@ -478,7 +468,6 @@ Mixer objects have the following methods:
|
|||||||
This method will return an empty tuple if the mixer is not an enumerated
|
This method will return an empty tuple if the mixer is not an enumerated
|
||||||
control.
|
control.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.getmute()
|
.. method:: Mixer.getmute()
|
||||||
|
|
||||||
Return a list indicating the current mute setting for each
|
Return a list indicating the current mute setting for each
|
||||||
@@ -486,7 +475,6 @@ Mixer objects have the following methods:
|
|||||||
|
|
||||||
This method will fail if the mixer has no playback switch capabilities.
|
This method will fail if the mixer has no playback switch capabilities.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.getrange(pcmtype=PCM_PLAYBACK)
|
.. method:: Mixer.getrange(pcmtype=PCM_PLAYBACK)
|
||||||
|
|
||||||
Return the volume range of the ALSA mixer controlled by this object.
|
Return the volume range of the ALSA mixer controlled by this object.
|
||||||
@@ -496,7 +484,6 @@ Mixer objects have the following methods:
|
|||||||
playback and capture volume. The default value is :const:`PCM_PLAYBACK`
|
playback and capture volume. The default value is :const:`PCM_PLAYBACK`
|
||||||
if the mixer has playback channels, otherwise it is :const:`PCM_CAPTURE`.
|
if the mixer has playback channels, otherwise it is :const:`PCM_CAPTURE`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.getrec()
|
.. method:: Mixer.getrec()
|
||||||
|
|
||||||
Return a list indicating the current record mute setting for each channel. 0
|
Return a list indicating the current record mute setting for each channel. 0
|
||||||
@@ -504,7 +491,6 @@ Mixer objects have the following methods:
|
|||||||
|
|
||||||
This method will fail if the mixer has no capture switch capabilities.
|
This method will fail if the mixer has no capture switch capabilities.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.getvolume(pcmtype=PCM_PLAYBACK)
|
.. method:: Mixer.getvolume(pcmtype=PCM_PLAYBACK)
|
||||||
|
|
||||||
Returns a list with the current volume settings for each channel. The list
|
Returns a list with the current volume settings for each channel. The list
|
||||||
@@ -515,7 +501,6 @@ Mixer objects have the following methods:
|
|||||||
playback and capture volume. The default value is :const:`PCM_PLAYBACK`
|
playback and capture volume. The default value is :const:`PCM_PLAYBACK`
|
||||||
if the mixer has playback channels, otherwise it is :const:`PCM_CAPTURE`.
|
if the mixer has playback channels, otherwise it is :const:`PCM_CAPTURE`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.setvolume(volume, channel=None, pcmtype=PCM_PLAYBACK)
|
.. method:: Mixer.setvolume(volume, channel=None, pcmtype=PCM_PLAYBACK)
|
||||||
|
|
||||||
Change the current volume settings for this mixer. The *volume* argument
|
Change the current volume settings for this mixer. The *volume* argument
|
||||||
@@ -540,7 +525,6 @@ Mixer objects have the following methods:
|
|||||||
|
|
||||||
This method will fail if the mixer has no playback mute capabilities
|
This method will fail if the mixer has no playback mute capabilities
|
||||||
|
|
||||||
|
|
||||||
.. method:: Mixer.setrec(capture, [channel])
|
.. method:: Mixer.setrec(capture, [channel])
|
||||||
|
|
||||||
Sets the capture mute flag to a new value. The *capture* argument
|
Sets the capture mute flag to a new value. The *capture* argument
|
||||||
@@ -628,6 +612,7 @@ To test PCM playback (on your default soundcard), run::
|
|||||||
|
|
||||||
recordtest.py and playbacktest.py
|
recordtest.py and playbacktest.py
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**recordtest.py** and **playbacktest.py** will record and play a raw
|
**recordtest.py** and **playbacktest.py** will record and play a raw
|
||||||
sound file in CD quality.
|
sound file in CD quality.
|
||||||
|
|
||||||
@@ -649,7 +634,7 @@ Without arguments, **mixertest.py** will list all available *controls* on the
|
|||||||
default soundcard.
|
default soundcard.
|
||||||
|
|
||||||
The output might look like this::
|
The output might look like this::
|
||||||
|
|
||||||
$ ./mixertest.py
|
$ ./mixertest.py
|
||||||
Available mixer controls:
|
Available mixer controls:
|
||||||
'Master'
|
'Master'
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ And then as root: --- ::
|
|||||||
|
|
||||||
# python setup.py install
|
# python setup.py install
|
||||||
|
|
||||||
|
|
||||||
*******
|
*******
|
||||||
Testing
|
Testing
|
||||||
*******
|
*******
|
||||||
|
|||||||
Reference in New Issue
Block a user