How to record audio from Python on Mac?

David Thole dthole at
Tue Sep 9 20:55:47 CEST 2008

On Sep 9, 1:11 pm, Kevin Walzer <k... at> wrote:
> s... at wrote:
> > (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
> You can probably access this functionality via PyObjC--it provides
> access to the Cocoa frameworks.
> --
> Kevin Walzer
> Code by Kevin

Another option you could use is calling Applescript from the command
line, to open, execute, and handle audio.

An easy example of this is with iTunes actually.  Once you get iTunes
down, doing this for other apps should be easy (if they have
applescript bindings):

You could probably also do what Kevin recommends, but depending on
your needs, this may be a whole lot more simple.

-David Thole

More information about the Python-list mailing list