hi,

pyaudio is pretty good for recording audio.  It is based on portaudio and
has binaries available for win/mac - and is included in many linux distros
too (so is pygame).


You can load, and play audio with pygame.  You can use the pygame.sndarray
module for converting the pygame.Sound objects into numpy arrays.

apt-get install python-pygame

import pygame, pygame.sndarray, sys
fname = sys.argv[1]
pygame.init()
sound = pygame.mixer.Sound(fname)
an_array = pygame.sndarray.array(sound)


Also see the sndarray demo: pygame.examples.sound_array_demos.
`python -m pygame.examples.sound_array_demos`

Other sndarray using examples can be found on pygame.org with the search
function.



Also audiolab uses bindings to libsndfile - so you can open a number of
formats.  However it is pretty new, so isn't packaged by distros(yet), and
there are no mac binaries(yet).  It's probably the best way to go if you can
handle compiling it yourself and the dependency.



cheers,
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to