0

I can play an mp3 no problem:

pygame.init()
fp = "sound.mp3"
pygame.mixer.music.load(fp)
pygame.mixer.music.play()

but I don't see an easy way to access the buffer/array of the decoded sound.

Opening with the Sound class just produces junk (It must be expecting wav):

s = pygame.mixer.Sound(fp)

what I want to do is eventually get the decoded array from a Sound object using:

a = pygame.sndarray.array(s)

But I can't seem to create a Sound object from an mp3 file.

new to Pygame..

Paul
  • 39,902
  • 14
  • 102
  • 121
  • The [pygame docs](http://www.pygame.org/docs/ref/music.html) say MP3 support is limited, consider using OGG instead. – martineau Dec 09 '14 at 17:30
  • @martineau when I try the same thing with an ogg, I get the error (from pygame/_numpysndarray.pyc): `ValueError: total size of new array must be unchanged` in the last step. – Paul Dec 09 '14 at 19:59

0 Answers0