[Tutor] PyAlsaAudio with Multiple Sound Cards?

Michael Lange klappnase at freenet.de
Sat Oct 21 16:31:24 CEST 2006

On Fri, 20 Oct 2006 18:13:04 -0400
"Rick Sterling" <rick__sterling at hotmail.com> wrote:

> Hi.
> I am pretty new to Python, but am trying to get up to speed so I move over 
> to Python from Perl.  One progam I wrote in Perl I am trying to re-write in 
> Python. It controls the mixer settings on my sound card.  I managed to 
> rewrite most of it by borrowing and stealing from the mixertest.py included 
> with PyAlsaAudio.
> I haven't been able to figure out on thing however.  I know that normally 
> when you assign the mixer with:
> mixer = alsaaudio.Mixer("Master")
> It seems to use the first card in the system.  My system has two sound 
> cards, and I can't figure out how to access the second card.  Digging around 
> online I found the following syntax:
> mixdev = alsaaudio.Mixer(mixer, id, device)
> I don't know what values it expects for id and device.  I have tried using 0 
> for the id and using "hw:1" for the device to no avail.  I am sure it is 
> something simple, but after trying many different things I still haven't 
> been able to figure out how to access my second sound card.

Hi Rick,

isn't there any documentation for pyalsaaudio? If no, maybe you would be better off
using ossaudiodev, which works well with ALSA, too.
For the device question, I guess they might want something like device=/dev/snd/hwC0D0
or however these device files are named on your system.

I hope this helps


More information about the Tutor mailing list