forked from auracaster/pyalsaaudio
Updates for release 0.3:
setup.py was extended for pypi. doc/index.html is automatically rewritten by doc/src/Makefile to add SourceForge links. index.html is now the standard homepage for pyalsaaudio. Minor documentation fixes (capitalisation, spelling, etc.). Caspers email is hidden in the documentation. git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@14 ec2f30ec-7544-0410-870e-f70ca00c83f0
This commit is contained in:
@@ -10,27 +10,28 @@
|
||||
<link rel="prev" href="pcm-objects.html" />
|
||||
<link rel="parent" href="module-alsaaudio.html" />
|
||||
<link rel="next" href="pcm-example.html" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name='aesop' content='information' />
|
||||
<title>4.3 Mixer Objects</title>
|
||||
</head>
|
||||
<body>
|
||||
<DIV CLASS="navigation">
|
||||
<div class="navigation">
|
||||
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
|
||||
<table align="center" width="100%" cellpadding="0" cellspacing="2">
|
||||
<tr>
|
||||
<td class='online-navigation'><a rel="prev" title="4.2 PCM Objects"
|
||||
<td class='online-navigation'><a rel="prev" title="4.2 pcm Objects"
|
||||
href="pcm-objects.html"><img src='previous.png'
|
||||
border='0' height='32' alt='Previous Page' width='32' /></A></td>
|
||||
border='0' height='32' alt='Previous Page' width='32' /></a></td>
|
||||
<td class='online-navigation'><a rel="parent" title="4 alsaaudio"
|
||||
href="module-alsaaudio.html"><img src='up.png'
|
||||
border='0' height='32' alt='Up One Level' width='32' /></A></td>
|
||||
<td class='online-navigation'><a rel="next" title="4.4 ALSA Examples"
|
||||
border='0' height='32' alt='Up one Level' width='32' /></a></td>
|
||||
<td class='online-navigation'><a rel="next" title="4.4 alsa Examples"
|
||||
href="pcm-example.html"><img src='next.png'
|
||||
border='0' height='32' alt='Next Page' width='32' /></A></td>
|
||||
border='0' height='32' alt='Next Page' width='32' /></a></td>
|
||||
<td align="center" width="100%">PyAlsaAudio</td>
|
||||
<td class='online-navigation'><a rel="contents" title="Table of Contents"
|
||||
href="contents.html"><img src='contents.png'
|
||||
border='0' height='32' alt='Contents' width='32' /></A></td>
|
||||
border='0' height='32' alt='Contents' width='32' /></a></td>
|
||||
<td class='online-navigation'><img src='blank.png'
|
||||
border='0' height='32' alt='' width='32' /></td>
|
||||
<td class='online-navigation'><img src='blank.png'
|
||||
@@ -38,26 +39,26 @@
|
||||
</tr></table>
|
||||
<div class='online-navigation'>
|
||||
<b class="navlabel">Previous:</b>
|
||||
<a class="sectref" rel="prev" href="pcm-objects.html">4.2 PCM Objects</A>
|
||||
<a class="sectref" rel="prev" href="pcm-objects.html">4.2 PCM Objects</a>
|
||||
<b class="navlabel">Up:</b>
|
||||
<a class="sectref" rel="parent" href="module-alsaaudio.html">4 alsaaudio</A>
|
||||
<a class="sectref" rel="parent" href="module-alsaaudio.html">4 alsaaudio</a>
|
||||
<b class="navlabel">Next:</b>
|
||||
<a class="sectref" rel="next" href="pcm-example.html">4.4 ALSA Examples</A>
|
||||
<a class="sectref" rel="next" href="pcm-example.html">4.4 ALSA Examples</a>
|
||||
</div>
|
||||
<hr /></div>
|
||||
</DIV>
|
||||
</div>
|
||||
<!--End of Navigation Panel-->
|
||||
|
||||
<H2><A NAME="SECTION002430000000000000000"></A>
|
||||
<A NAME="mixer-objects"></A>
|
||||
<BR>
|
||||
<h2><a name="SECTION002430000000000000000"></a>
|
||||
<a name="mixer-objects"></a>
|
||||
<br>
|
||||
4.3 Mixer Objects
|
||||
</H2>
|
||||
</h2>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
Mixer objects provides access to the ALSA mixer API.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><span class="typelabel">class</span> <tt id='l2h-16' xml:id='l2h-16' class="class">Mixer</tt></b>(</nobr></td>
|
||||
<td><var></var><big>[</big><var>control</var><big>]</big><var>, </var><big>[</big><var>id</var><big>]</big><var>, </var><big>[</big><var>cardname</var><big>]</big><var></var>)</td></tr></table></dt>
|
||||
@@ -66,18 +67,18 @@ Mixer objects provides access to the ALSA mixer API.
|
||||
of available controls can be found with the <tt class="module">alsaaudio</tt>.<tt class="function">mixers</tt> function.
|
||||
The default value is 'Master' - other common controls include 'Master Mono', 'PCM', 'Line', etc.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<var>id</var> - the id of the mixer control. Default is 0
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<var>cardname</var> - specifies which card should be used (this is only relevant
|
||||
if you have more than one sound card). Omit to use the default sound card
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
Mixer objects have the following methods:
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-17' xml:id='l2h-17' class="method">cardname</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -85,7 +86,7 @@ Mixer objects have the following methods:
|
||||
Return the name of the sound card used by this Mixer object
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-18' xml:id='l2h-18' class="method">mixer</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -94,7 +95,7 @@ Return the name of the specific mixer controlled by this object, For example 'Ma
|
||||
or 'PCM'
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-19' xml:id='l2h-19' class="method">mixerid</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -102,7 +103,7 @@ or 'PCM'
|
||||
Return the ID of the ALSA mixer controlled by this object.
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-20' xml:id='l2h-20' class="method">switchcap</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -110,7 +111,7 @@ Return the ID of the ALSA mixer controlled by this object.
|
||||
Returns a list of the switches which are defined by this specific mixer. Possible values in
|
||||
this list are:
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<div class="center"><table class="realtable">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -119,27 +120,27 @@ this list are:
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Mute'</volume></td>
|
||||
<td class="left" >This mixer can be muted</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Mute'</volume></td>
|
||||
<td class="left" >This mixer can mute all channels at the same time</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Playback Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Playback Mute'</volume></td>
|
||||
<td class="left" >This mixer can mute the playback output</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Playback Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Playback Mute'</volume></td>
|
||||
<td class="left" >Mute playback for all channels at the same time</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Capture Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Capture Mute'</volume></td>
|
||||
<td class="left" >Mute sound capture</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Capture Mute'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Capture Mute'</volume></td>
|
||||
<td class="left" >Mute sound capture for all channels at a time</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Capture Exclusive'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Capture Exclusive'</volume></td>
|
||||
<td class="left" >Not quite sure what this is</td></tr></tbody>
|
||||
</table></div>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
To manipulate these swithes use the <tt class="method">setrec</tt> or <tt class="method">setmute</tt> methods
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-21' xml:id='l2h-21' class="method">volumecap</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -147,7 +148,7 @@ To manipulate these swithes use the <tt class="method">setrec</tt> or <tt class=
|
||||
Returns a list of the volume control capabilities of this mixer. Possible values in
|
||||
the list are:
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<div class="center"><table class="realtable">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -156,24 +157,24 @@ the list are:
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Volume'</volume></td>
|
||||
<td class="left" >This mixer can control volume</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Volume'</volume></td>
|
||||
<td class="left" >This mixer can control volume for all channels at the same time</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Playback Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Playback Volume'</volume></td>
|
||||
<td class="left" >This mixer can manipulate the playback volume</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Playback Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Playback Volume'</volume></td>
|
||||
<td class="left" >Manipulate playback volumne for all channels at the same time</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Capture Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Capture Volume'</volume></td>
|
||||
<td class="left" >Manipulate sound capture volume</td></tr>
|
||||
<tr><td class="left" valign="baseline"><Volume Capabilities>'Joined Capture Volume'</Volume></td>
|
||||
<tr><td class="left" valign="baseline"><volume capabilities>'Joined Capture Volume'</volume></td>
|
||||
<td class="left" >Manipulate sound capture volume for all channels at a time</td></tr></tbody>
|
||||
</table></div>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-22' xml:id='l2h-22' class="method">getvolume</tt></b>(</nobr></td>
|
||||
<td><var></var><big>[</big><var>direction</var><big>]</big><var></var>)</td></tr></table></dt>
|
||||
@@ -181,26 +182,26 @@ the list are:
|
||||
Returns a list with the current volume settings for each channel. The list elements
|
||||
are integer percentages.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
The optional <var>direction</var> argument can be either 'playback' or 'capture', which is relevant
|
||||
if the mixer can control both playback and capture volume. The default value is 'playback'
|
||||
if the mixer has this capability, otherwise 'capture'
|
||||
|
||||
<P>
|
||||
<p>
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-23' xml:id='l2h-23' class="method">getmute</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
<dd>
|
||||
Return a list indicating the current mute setting for each channel. 0 means not muted, 1 means muted.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
This method will fail if the mixer has no playback switch capabilities.
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-24' xml:id='l2h-24' class="method">getrec</tt></b>(</nobr></td>
|
||||
<td><var></var>)</td></tr></table></dt>
|
||||
@@ -208,11 +209,11 @@ This method will fail if the mixer has no playback switch capabilities.
|
||||
Return a list indicating the current record mute setting for each channel. 0 means not recording, 1
|
||||
means not recording.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
This method will fail if the mixer has no capture switch capabilities.
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-25' xml:id='l2h-25' class="method">setvolume</tt></b>(</nobr></td>
|
||||
<td><var>volume,</var><big>[</big><var>channel</var><big>]</big><var>,</var><big>[</big><var>direction</var><big>]</big><var></var>)</td></tr></table></dt>
|
||||
@@ -220,32 +221,32 @@ This method will fail if the mixer has no capture switch capabilities.
|
||||
Change the current volume settings for this mixer. The <var>volume</var> argument controls
|
||||
the new volume setting as an integer percentage.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
If the optional argument <var>channel</var> is present, the volume is set only for this channel. This
|
||||
assumes that the mixer can control the volume for the channels independently.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
The optional <var>direction</var> argument can be either 'playback' or 'capture' is relevant if the mixer
|
||||
has independent playback and capture volume capabilities, and controls which of the volumes
|
||||
if changed. The default is 'playback' if the mixer has this capability, otherwise 'capture'.
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-26' xml:id='l2h-26' class="method">setmute</tt></b>(</nobr></td>
|
||||
<td><var>mute, </var><big>[</big><var>channel</var><big>]</big><var></var>)</td></tr></table></dt>
|
||||
<dd>
|
||||
Sets the mute flag to a new value. The <var>mute</var> argument is either 0 for not muted, or 1 for muted.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
The optional <var>channel</var> argument controls which channel is muted. The default is to set the mute flag
|
||||
for all channels.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
This method will fail if the mixer has no playback mute capabilities
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
|
||||
<td><nobr><b><tt id='l2h-27' xml:id='l2h-27' class="method">setrec</tt></b>(</nobr></td>
|
||||
<td><var>capture,</var><big>[</big><var>channel</var><big>]</big><var></var>)</td></tr></table></dt>
|
||||
@@ -253,57 +254,57 @@ This method will fail if the mixer has no playback mute capabilities
|
||||
Sets the capture mute flag to a new value. The <var>capture</var> argument is either 0 for no capture,
|
||||
or 1 for capture.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
The optional <var>channel</var> argument controls which channel is changed. The default is to set the capture flag
|
||||
for all channels.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
This method will fail if the mixer has no capture switch capabilities
|
||||
</dl>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
<b>A Note on the ALSA Mixer API</b>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
The ALSA mixer API is extremely complicated - and hardly documented at all. <tt class="module">alsaaudio</tt> implements
|
||||
a much simplified way to access this API. In designing the API I've had to make some choices which
|
||||
may limit what can and cannot be controlled through the API. However, If I had chosen to implement the
|
||||
full API, I would have reexposed the horrible complexity/documentation ratio of the underlying API.
|
||||
At least the <tt class="module">alsaaudio</tt> API is easy to understand and use.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
If my design choises prevents you from doing something that the underlying API would have allowed,
|
||||
please let me know, so I can incorporate these need into future versions.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
If the current state of affairs annoy you, the best you can do is to write a HOWTO on the API and
|
||||
make this available on the net. Until somebody does this, the availability of ALSA mixer capable
|
||||
devices will stay quite limited.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
Unfortunately, I'm not able to create such a HOWTO myself, since I only understand half of the API,
|
||||
and that which I do understand has come from a painful trial and error process.
|
||||
|
||||
<P>
|
||||
<p>
|
||||
|
||||
<DIV CLASS="navigation">
|
||||
<div class="navigation">
|
||||
<div class='online-navigation'>
|
||||
<p></p><hr />
|
||||
<table align="center" width="100%" cellpadding="0" cellspacing="2">
|
||||
<tr>
|
||||
<td class='online-navigation'><a rel="prev" title="4.2 PCM Objects"
|
||||
<td class='online-navigation'><a rel="prev" title="4.2 pcm Objects"
|
||||
href="pcm-objects.html"><img src='previous.png'
|
||||
border='0' height='32' alt='Previous Page' width='32' /></A></td>
|
||||
border='0' height='32' alt='Previous Page' width='32' /></a></td>
|
||||
<td class='online-navigation'><a rel="parent" title="4 alsaaudio"
|
||||
href="module-alsaaudio.html"><img src='up.png'
|
||||
border='0' height='32' alt='Up One Level' width='32' /></A></td>
|
||||
<td class='online-navigation'><a rel="next" title="4.4 ALSA Examples"
|
||||
border='0' height='32' alt='Up one Level' width='32' /></a></td>
|
||||
<td class='online-navigation'><a rel="next" title="4.4 alsa Examples"
|
||||
href="pcm-example.html"><img src='next.png'
|
||||
border='0' height='32' alt='Next Page' width='32' /></A></td>
|
||||
border='0' height='32' alt='Next Page' width='32' /></a></td>
|
||||
<td align="center" width="100%">PyAlsaAudio</td>
|
||||
<td class='online-navigation'><a rel="contents" title="Table of Contents"
|
||||
href="contents.html"><img src='contents.png'
|
||||
border='0' height='32' alt='Contents' width='32' /></A></td>
|
||||
border='0' height='32' alt='Contents' width='32' /></a></td>
|
||||
<td class='online-navigation'><img src='blank.png'
|
||||
border='0' height='32' alt='' width='32' /></td>
|
||||
<td class='online-navigation'><img src='blank.png'
|
||||
@@ -311,17 +312,17 @@ and that which I do understand has come from a painful trial and error process.
|
||||
</tr></table>
|
||||
<div class='online-navigation'>
|
||||
<b class="navlabel">Previous:</b>
|
||||
<a class="sectref" rel="prev" href="pcm-objects.html">4.2 PCM Objects</A>
|
||||
<a class="sectref" rel="prev" href="pcm-objects.html">4.2 PCM Objects</a>
|
||||
<b class="navlabel">Up:</b>
|
||||
<a class="sectref" rel="parent" href="module-alsaaudio.html">4 alsaaudio</A>
|
||||
<a class="sectref" rel="parent" href="module-alsaaudio.html">4 alsaaudio</a>
|
||||
<b class="navlabel">Next:</b>
|
||||
<a class="sectref" rel="next" href="pcm-example.html">4.4 ALSA Examples</A>
|
||||
<a class="sectref" rel="next" href="pcm-example.html">4.4 ALSA Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<span class="release-info">Release 0.2.</span>
|
||||
</DIV>
|
||||
<span class="release-info">Release 0.3.</span>
|
||||
</div>
|
||||
<!--End of Navigation Panel-->
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user