[Tutor] wav audio playback

Adam Pridgen Adam.Pridgen at gmail.com
Mon Feb 26 08:41:01 CET 2007

You are getting these errors because the API for Python varies by
release (e.g. 2.4 to 2.5)  due to additions, bug fixes, etc..  The
warning you are receiving is letting you know that it was compiled and
meant to be run on Python 2.4, and also subtly warning that problems
may arise when you run or write your scripts in the 2.5 environment.

To get rid of the error safely, if possible compile PyAudio for Python
2.5, or if you can regress back to Python 2.4 until PyAudio package is
available for Python 2.5.  There might also be a flag that can be set
to ignore warnings when you run the Python, but I am not sure about
this.  Some of the more Pythonic vets on the list might be able to
provide feed back on that.

However, from my past experience, regressing back to Python 2.4 seems
to be the easiest and safest option in most cases.


On 2/26/07, Isaac <hyperneato at gmail.com> wrote:
> hello from a programming newbie.
> I am writing a metronome function.
> Currently, I am using a hack with the system bell:
> [code]
> def tick(rate):
>     while true: #do until C-c
>         print '\a' #system bell inside terminal
>         time.sleep(rate) #pause at desired rate
> [/code]
> 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
> get:
> """
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyaudio.py:101:
> 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, eventually)
>  Using Python 2.5
> cheers
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list