pygame sound command?

Hi all I got the pygame working great for my backdrop music…
But when I try pygame sound I have been getting into a bit of trouble.

Perhaps it is just my syntax,

Here is the script:

import pygame.mixer                                     

it tells me:

Traceback (most recent call last):
File “bonus”, line 7, in <module>
TypeError: descriptor ‘play’ of ‘pygame.mixer.Sound’ object needs an argument
I think I am going to go totally mad, I am so close :smiley:

well, I found this:

but the example files are all 404


I got a solution

The sound file was bonus.ogg

 import pygame.mixer                                     
sound = pygame.mixer.Sound('bonus.ogg')

man I cant believe how simple it was :smiley: I was way off on my first guess.

just for trivia sake here is the background music

import pygame.mixer                                           
import os
pygame.mixer.init()                                     "Music.ogg")   

I am so happy! I am going to be able to release a game demo in the near future :smiley:

Thanks for sharing Mmph!

Do you have any other tips for installing it and getting it working. I had a look but haven’t tried it yet. Everything seems to be about earlier versions of blender and python. Any words of advice would be gratefully received.

Hi Larryboy!

Sure I made a new updated package for python 2.5 and the bleeding edge version of pygame.

I also put up some scripts I learned , you can find it here:

have fun!
Pygame totally rocks my demo! I have yet to have a sound cut out on me!