473,698 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2757
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
2342
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: homeostasis</title> <link href="liveink.css" type="text/css" rel="stylesheet"/> </head> <body>
0
1131
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 an mp3 file on OSX, but am running into some difficulty. When using py-mad and py-ao, I only get static with the following code (which is derived off another mailing that I found from
6
1914
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 running. Any tips on the code quality and use of python would be appreciated. I've got a feeling the overall structure is up the creek. approx 220 LOC. file: GodCast.py
0
1117
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 proceed) I'd love the help. I'm fairly new to Python, but not to OO programming. I've written a simple wx application that uses an SpSharedRecognizer for voice recognition, and currently sendKeys to send control applications. The basic ideas...
7
336
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 Brazil. If I open file to parse in VI, looks like: <Utt id="3" transcribe="yes" audioRoot="A1"
25
2338
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 hoping that someone here could help point me to a group/project that would be a good starting place for a person with limited python knowledge, but that is willing to learn whatever is necessary. I'm hoping that with a goal I can start to learn...
0
2283
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. The Docs, say that asBands() return a List of tupples grouped by frquenciy, and the first two values are frquency limits. But I dont thonk so ! Its not seems to be correct!
1
2180
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 at one push of a button for colours to be added in squares, circles, and for audio responses to these to sound when for example, red circles, blue squares, or foods, etc are found in text added to multiline textbox. My second son can benefit from...
5
3198
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 recording or about Apple APIs via Python. Pointers to simple examples would be much appreciated. Thanks, Skip
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.