Python audio output switch

P

Pan Xingzhi

Guys:

Hi there. Recently I'll have to write a quite interesting program
in Python on a Linux box. What I need is a function which allows the
user to 'switch' the audio output from <an audio
file>/<microphone>/<line in>.

I'm not quite familiar with Linux programming. I've checked some
python media frameworks but still need some light. Does anybody have
experience on this? Thanks in advance!

Regards,
Pan Xingzhi
 
B

Ben Sizer

Pan said:
Guys:

Hi there. Recently I'll have to write a quite interesting program
in Python on a Linux box. What I need is a function which allows the
user to 'switch' the audio output from <an audio
file>/<microphone>/<line in>.

They are audio inputs, not audio outputs!

I don't know of any Python modules for this, though maybe one exists.
Most documentation is for C coders, and depends a lot upon what sound
system your distribution of Linux is running. If you are using OSS
(Open Sound System), you may be able to access /dev/mixer to choose
which device is the default input. (Although I am more used to systems
where you can read each input independently.) If so, you may find this
page gives you a few pointers:
http://www.oreilly.de/catalog/multilinux/excerpt/ch14-07.htm

If you are using something else, like ALSA, you may want to look at
their documentation. Or perhaps http://jackaudio.org/ will be of use.
 
P

Pan Xingzhi

Sorry maybe I didn't describe what I need clearly. Yes they're inputs.
Actually I need a switch to 'hook' them to line out so when I switch, a
mp3 file is played, or an external CD player is played, or what I'm
talking is played.

Thanks anyway. I'm checking ALSA, though maybe I'll have to write sth in
C :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top