469,336 Members | 5,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

audio on os x using python, mad, ao

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
this list's archives):
#!/usr/bin/env python

'''Requires:
py-mad (mp3 ability)
py-ao (system audio ability)
'''
import mad, ao, sys
mf = mad.MadFile(sys.argv[1])
dev = ao.AudioDevice('macosx')#osx device, linux: use "oss" or "alsa"
while 1:
buf = mf.read()
if buf is None:
break
dev.play(buf, len(buf))

Does anyone know why this produces static, or whether there's a better
method of producing audio output that's also cross-platform (OSX,
linux)? I've looked at pymedia, but they do not support OSX at the
moment.

Thanks!"

May 3 '06 #1
0 1014

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bruce Bon | last post: by
1 post views Thread by Noah | last post: by
1 post views Thread by Ron Provost | last post: by
2 posts views Thread by andrea valle | last post: by
2 posts views Thread by Pan Xingzhi | last post: by
6 posts views Thread by Putty | last post: by
4 posts views Thread by Ultrus | last post: by
5 posts views Thread by skip | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.