471,624 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

Python audio output switch

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
Jul 25 '06 #1
2 2666
Pan Xingzhi wrote:
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/multil...pt/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.

--
Ben Sizer

Jul 26 '06 #2
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 :)

Ben Sizer wrote:
Pan Xingzhi wrote:
>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/multil...pt/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.
Jul 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by laredotornado | last post: by
reply views Thread by apa7hy.spam | last post: by
6 posts views Thread by Lex Hider | last post: by
reply views Thread by Sean Kennedy | last post: by
7 posts views Thread by gheissenberger | last post: by
25 posts views Thread by Eric | last post: by
reply views Thread by Carlos Leite | last post: by
5 posts views Thread by skip | last post: by
1 post views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.