How to record audio from Python on Mac?

David Thole dthole at gmail.com
Tue Sep 9 14:55:47 EDT 2008


On Sep 9, 1:11 pm, Kevin Walzer <k... at codebykevin.com> wrote:
> s... at pobox.com 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 Kevinhttp://www.codebykevin.com

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):
http://www.macosxhints.com/article.php?story=20011108211802830

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

-David Thole
http://www.thedarktrumpet.com



More information about the Python-list mailing list