[Tutor] wav audio playback

Isaac hyperneato at gmail.com
Mon Feb 26 08:20:56 CET 2007

hello from a programming newbie.

I am writing a metronome function.
Currently, I am using a hack with the system bell:

def tick(rate):
    while true: #do until
        print '\a' #system bell inside
        time.sleep(rate) #pause at desired

I would like to use any audio clip for a 'beat' of the metronome.
I have looked into pyaudio for .wav clips. I installed the binary for
pyaudio but it put the files into site-packages folder in
my python-2.4 framework directory; I copied the files to the site-packages
folder under 2.5 but when I import pyaudio at the Python 2.5 interpreter I

RuntimeWarning: Python C API version mismatch for module _portaudio: This
Python has API version 1013, module _portaudio has version 1012.
  import _portaudio as pa   """

It does play sound but how can I get rid of this error? Do I have to wait
for the newer version of portaudio and/or pyaudio to be released to keep
this error from happening? Should I be concerned with this warning?
Is there another, better, sound playback module that anyone recommend I
could use?

I have mac ppc os X 10.4.8 (would like to have cross platform functionality,
Using Python 2.5

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070225/8aa97800/attachment.htm 

More information about the Tutor mailing list