473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 2745
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: laredotornado | last post by:
Hello, I want to play an audio file by clicking on an audio icon and not having the page switch out underneath. Right now the code I have is ... <html> <head> <title>Dictionary:...
0
by: apa7hy.spam | last post by:
this message was originally posted by someone else and closed without a proper answer. i'm reposting it in hopes that someone will provide a solution. Begin Quote: "I'm attempting to play...
6
by: Lex Hider | last post by:
Hi, Apologies if this is against etiquette. I've just got my first python app up and running. It is a podcast aggregator depending on feedparser. I've really only learnt enough to get this up and...
0
by: Sean Kennedy | last post by:
Ok - I've done a lot of searching with google for info on what I'm about to ask, and haven't found enough to accomplish what I'm after - so if anyone has the answers (or even just ideas on how to...
7
by: gheissenberger | last post by:
HELP! Guy who was here before me wrote a script to parse files in Python. Includes line: print u where u is a line from a file we are parsing. However, we have started recieving data from...
25
by: Eric | last post by:
Hello, after reading some of the book Programming Python it seems that python is something I would like to delve deeper into. The only thing is, I have no idea what I should try and write. So I was...
0
by: Carlos Leite | last post by:
Is there any other option to analyze audio frequencies? Or Any here try to use pymedia to a simple audio FingerPrint. A cant understand what the information the asBands() really giveme....
1
Dököll
by: Dököll | last post by:
Greetings, Good buddies! I am for the first time, since I started learning VB, going to build an application I wanted to build for my first son, a language and activities program that will allow...
5
by: skip | last post by:
(I asked this on pythonmac-sig a couple days ago but got no response, so I'm casting a broader net.) Can I easily control audio record/playback from Python on my Mac? I know zip about audio...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.