python - Sound shortened in PyGame -


i'm using ubuntu 10.4 , learning pygame following tutorial 'pummel chimp , win $$$'.

i made 2 '.wav' files, when try play them, strange noise thud, short.

i don't error message. why doesn't work expected?

>>> import pygame >>> pygame.init() (6, 0) >>> def load_sound(name):     class nonesound(object):         def play(self): pass     if not pygame.mixer:         return nonesound()     fullname = os.path.join('data', name)     try:         sound = pygame.mixer.sound(fullname)     except pygame.error, message:         print 'cannot load sound:', name         raise systemexit, message     return sound  >>> whiff_sound = load_sound('whiff.wav') >>> whiff_sound.play() <channel object @ 0xb772f1c0> >>>  

here wav i'm using. (broken link)

i had same problem sound, opened sound in program called wavepad sound editor , re-saved file .wav , set sample rate 22050 hz , solved problem.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -