[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Problem with get_length and mp3



hi,

pygame has dodgey mp3 support, as it uses smpeg which doesn't do mp3 very well.

Mostly it's a good idea to use ogg vorbis format if you can, or use a
different way to convert the mp3 files to wav files then load those
with pygame.

cheers,



On Fri, Jun 20, 2008 at 10:10 PM, Stefan Huchler <s.huchler@xxxxxxxxx> wrote:
> Hi,
>
> i have following problem with pygame:
>
>>>> import pygame
>>>> pygame.mixer.init()
>>>> pygame.mixer.Sound('test.mp3')
> <pygame.mixer.Sound object at 0x7f16a8616350>
>>>> x = pygame.mixer.Sound('test.mp3')
>>>> x.get_length()
> 9.0702946181409061e-05
>
> the mp3 is 5min 18 sec long (xmms)
>
> pygame v. 1.8
>
> pygame < 1.8 dont support mp3 with pygame.mixer.Sound module and
> pygame.mixer.music has no get_lenth method so i have to use > 1.8
> i postet the problem on your irc channel one guy (_raz_) testet it
> with latest svn trunk, he confirmed that this bug is also with this
> version.
>
>
> greetings
>
> Stefan Huchler
> www.canta-game.org
>