views:

67

answers:

2

I'm using python and dbus. What i really need is a way to get the input from my microphone into my python program and then play it back from the program. I googled a lot and it seems pyaudio might do the trick but pyaudio does not work with my ubuntu 10.04.

The next option i saw was telepathy. But i don't need something that big, either. Seeing how telepathy works over dbus, i fugured this might be the way to go.

Unfortunately i'm unable to connect to the Harware Abstraction LAyer ans use it to get the input from my microphone. Is there any way to do this, or should i seek elsewhere?

A: 

HAL: I'm sorry, Dave. I'm afraid I can't do that.

Johnsyweb
A: 

This is really not related to HAL or D-Bus at all. Telepathy's definitely not the answer: it's an IM framework. :) If I were you, I'd look at GStreamer, which is the standard multimedia framework on the Linux desktop, via the pygst binding.

You'll want to use the gconfaudiosrc element to pull audio from the default microphone, and send it to gconfaudiosink. To check that this works, run gst-launch-0.10 gconfaudiosrc ! gconfaudiosink in a terminal: you should hear everything you say into your microphone echoed out of your speakers.

This blog post by the Internet's Jono Bacon might be a good starting point. You could try modifying it to use gconfaudiosrc rather than filesrc, decodebin and audioconvert. You could also take a look at this tutorial; the GStreamer Application Development Manual is a lot more detailed.

wjt
This information is very useful for me.thank you very much for your responce.