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

Re: [pygame] playing MP3s using pygame




--- Frank Raiser <crashchaos@gmx.net> wrote:
> On Tue, Apr 09, 2002 at 09:40:13AM -0400, Prahlad
> Vaidyanathan wrote:
> > Someone on the python-tutor list mentioned that I
> could play MP3s using
> > pygame. So, I built pygame with SDL_mixer, and did
> the following :
> 
> build it with smpeg support too.
> 
> > Hence I gather pygame does not support MP3s - am I
> right, or is there
> > some black magic I can do to make it support them.
> 
> err.. it does. Except that mp3 is an mpeg layer and
> therefore supported
> by smpeg. Try this:
> 
> import pygame,pygame.movie
> m = pygame.movie.Movie("some file.mp3")
> m.play()
> print "yes it looks strange playing a movie when you
> just want sound :)"
> 
> Maybe some magic code for the mixer wouldn't hurt so
> that it
> automatically forwards mp3 handling to smpeg if it's
> installed
> and available. Might make it a little bit more
> intuitive.

Um, if smpeg is installed, pygame's mixer will play
mp3s.  You don't need to use the movie module.  Unless
something has changed since pygame 1.0.

Mixer is a frontend to different music decoders, ogg,
mod, midi, mp3, wav.  If you don't have the decoders
in the right place when you build mixer, it won't
compile with support for those formats.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org