471,888 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,888 software developers and data experts.

play audio on OSX?

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

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:
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.

Sep 30 '05 #1
0 1282

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Steve K | last post: by
6 posts views Thread by Andrew Poulos | last post: by
reply views Thread by laredotornado | last post: by
1 post views Thread by Ron Provost | last post: by
reply views Thread by universe | last post: by

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.