wav player using wxPython and pygame - wavplayer.py (0/1)

Dirk Krause d_krause at pixelpark.com
Tue Sep 11 09:23:36 EDT 2001


Here's the code that works for me (under Win2000):

import pygame
import pygame.mixer

from pygame.locals import *

pygame.mixer.init()

pygame.mixer.pre_init(44100,16)
pygame.mixer.music.load("(saga)-[heads_or_tales_03]-sound_of_strangers.mp3")
pygame.mixer.music.play()

while 1: pass

Andrei Kulakov <sill at optonline.net> wrote in message news:<slrn9pnr85.dnt.sill at sill.silmarill.org>...
> On Sun, 09 Sep 2001 15:55:19 GMT, ibwonrr at yahoo.com <ibwonrr at yahoo.com> wrote:
> > I've written a simple (read: ugly) wav player using pygame and
> > wxPython.  It can play, stop, pause, and shows the current and total
> > time of the wav file.  It can also convert wav files to mp3 using
> > BladeEnc (freeware for win32).
> > 
> > My goal was to write an mp3 player, but I couldn't get mp3s  to load
> > using pygame.mixer.music.load() (under windows 2000).  If anyone knows
> > how to do this, please let me know.
> 
> Look into xaudio (xaudio.com). There's also pyxaudio. Alternatively, you
> could just call mpg123 or somesuch. I made an mp3 player that does that -
> in the sig.
> 
> - Andrei



More information about the Python-list mailing list