[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] pygame.mixer.music



On Tue, 1 Oct 2002, azazel wrote:

> In the documentation I've read that this module is
> optional, how can I use it?  I have sdl_mixer library, but
> all the application that I have downloaded tell me that
> pygame.mixer hasn't the module music


I think you may have to install it seperately on unix (??)
but it comes with the win32 installer.  Here is some example
code from something I wrote:


WINSIZE = (500, 400)
CENTER = (WINSIZE[0]/2,WINSIZE[1]/2)

MUSIC = "vivaldi_winter_largo.mid"


def init():
    pygame.mixer.pre_init(16000)
    pygame.init()
    screen = pygame.display.set_mode(WINSIZE)
    pygame.display.set_caption("learnfast")
    clock = pygame.time.Clock()
    if pygame.mixer.get_init():
        pygame.mixer.music.load(MUSIC)
        pygame.mixer.music.play(-1)
    return screen,clock


Cheers,

- Michal   http://www.sabren.net/   sabren@manifestation.com 
------------------------------------------------------------
Switch to Cornerhost!             http://www.cornerhost.com/
 Low Priced, Reliable Blog Hosting, With a Human Touch. :)
------------------------------------------------------------


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org