I am having problems loading and playing sounds in pygame. Most people seem to have problems with MP3s, but for some reason I can't even play WAV.
>>> f=open('menuscreen.wav',"rb") >>> pygame.mixer.init() >>> pygame.mixer.music.load(f) Traceback (most recent call last): File "<string>", line 1, in <fragment> pygame.error: Module format not recognized
and this also does not work:
>>> k = pygame.mixer.Sound('menuscreen.wav') >>> pygame.mixer.init() >>> pygame.mixer.music.load(k) Traceback (most recent call last): File "<string>", line 1, in <fragment> pygame.error: Couldn't read from RWops
and does not do this:
>>> import pygame >>> pygame.mixer.init() >>> pygame.mixer.music.load('menuscreen.wav') Traceback (most recent call last): File "<string>", line 1, in <fragment> pygame.error: Unable to load WAV file
I am using 2.7.2 and pygame 1.9.1
source share