[pygame] Problem with get_length and mp3
Hi, i have following problem with pygame: >>> import pygame >>> pygame.mixer.init() >>> pygame.mixer.Sound('test.mp3') >>> 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
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
Hi, k then i cant use pygame for preview, i will be using it for the songs at the moment but when i find something plattform-independent which uses a better codec i will be choose it, i have no influence in what the users make for mp3-files and stuff they should use the many files which are in p2p-networks for ultrastar or use mp3s which made with windoof tools by them self, again i had no problem if smeg or pygame do not play all files but that a bad mp3-file crash the prozess without try catch or other ways to prevent this is really bad. i will try next week searching few files which does not work either, and show if there all have vbr or stuff, then i can check that before i play the file. i send my results in this mailinglist then. greetings Stefan On 11/3/07, Pete Shinners <[EMAIL PROTECTED]> wrote: > Lenard Lindstrom wrote: > > Pygame uses smpeg for mp3s. smpeg hasn't changed in SVN for at least a > > year, so any recently installed version should be up-to-date. > > The SMPEG library is a fairly simple mpeg decoder. It will not do a good > job with MP3 files that are VBR or have an ID3V2 tag. If you have an mp3 > that isn't playing well, try to run it through a quality encoder and set > it to basic encoding options. Even better would be convert the MP3 into > an OGG. Smaller file and better compatibility. > > >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
I use ubuntu gutsy gibbon and gentoo (and there stable versions of smpeg). http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=libsmpeg&searchon=names&subword=1&version=gutsy&release=all gentoo packages.db site is not availible at the moment. And the errors occur on different machines. should i come in irc? i try to come on the mp3file (if i have running there some file-servers (ssh...)) then i can send you over dcc the file? On 11/2/07, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Ethan Glasser-Camp wrote: > > Does anyone on the list know what library decompresses MP3s on Pygame? I > > think it's smpeg, so Stefan, could you tell me what version of smpeg > > you have installed and see if a newer version is available? (I have > > libsmpeg0 from Debian unstable.) > > > > > > > > Pygame uses smpeg for mp3s. smpeg hasn't changed in SVN for at least a > year, so any recently installed version should be up-to-date. > > > > -- > Lenard Lindstrom > <[EMAIL PROTECTED]> > >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
Hi, i did not say that jamila makes pygame hang, i said "some mp3s" there are not in our svn repos and jamila could also be gone soon, i cant upload this files there because i dont want a law action(copyright) in my brief case. should i send you the file? I dont know that i can get the file today because i am this weekend not at home, but i will try to get it or send it to you at least on monday. On 11/2/07, Ethan Glasser-Camp <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Stefan Huchler wrote: > > sorry thats the root: svn://blackiwid.dyndns.org/var/svn/repos > > So Jamelia - Superstar (Demo).mp3 causes the process to hang? It works > OK on my system. > > [EMAIL PROTECTED]:~/repos/trunk/gui/songs$ python > Python 2.4.4 (#2, Aug 16 2007, 02:03:40) > [GCC 4.1.3 20070812 (prerelease) (Debian 4.1.2-15)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import pygame > >>> pygame.mixer.init() > >>> pygame.mixer.music.load("Jamelia - Superstar (Demo)/Jamelia - > Superstar (Demo).mp3") > >>> pygame.mixer.music.play() > > Repeated calls to pygame.mixer.music.play() restart the song. > > Furthermore, I don't see any horrible breakage in the mp3 itself: > > [EMAIL PROTECTED]:~/repos/trunk/gui$ mp3val songs/Jamelia\ -\ Superstar\ > \(Demo\)/Jamelia\ -\ Superstar\ \(Demo\).mp3 > Analyzing file "Jamelia - Superstar (Demo).mp3"... > INFO: "/home/ethan/repos/trunk/gui/songs/Jamelia - Superstar > (Demo)/Jamelia - Superstar (Demo).mp3": 2812 MPEG frames (MPEG 2 Layer > III), +ID3v1+ID3v2, CBR, CRC > Done! > [EMAIL PROTECTED]:~/repos/trunk/gui$ mp3check -a songs/Jamelia\ -\ > Superstar\ \(Demo\)/Jamelia\ -\ Superstar\ \(Demo\).mp3 > songs/Jamelia - Superstar (Demo)/Jamelia - Superstar (Demo).mp3: > anomaly: audio mpeg version 2.0 stream > anomaly: sampling rate 22.1kHz > anomaly: bitrate 32kbit/s > anomaly: mode single chann > > What OS are you using? You mentioned this happens on Gentoo with > Gentoo's version of pygame. What sound hardware are you using? Does > anyone on the list know what library decompresses MP3s on Pygame? I > think it's smpeg, so Stefan, could you tell me what version of smpeg > you have installed and see if a newer version is available? (I have > libsmpeg0 from Debian unstable.) > > Ethan > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHK2wKhRlgoLPrRPwRAgfqAKDG06wd6x5Wd0cb7ZCwDCwKN0HLlwCeKfRg > fzUtVzWs7O5UrvDooIKIlNA= > =fSBv > -END PGP SIGNATURE- >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
sorry thats the root: svn://blackiwid.dyndns.org/var/svn/repos On 11/1/07, Ethan Glasser-Camp <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Stefan Huchler wrote: > > you can get the source from > > svn://blackiwid.dyndns.org/repos/trunk/gui/lib/player/ > > > > or > > svn://blackiwid.dyndns.org/repos/trunk/gui/ > > [EMAIL PROTECTED]:~$ svn co > svn://blackiwid.dyndns.org/repos/trunk/gui/lib/player/ > svn: No repository found in > 'svn://blackiwid.dyndns.org/repos/trunk/gui/lib/player' > [EMAIL PROTECTED]:~$ svn co svn://blackiwid.dyndns.org/repos/trunk/gui/ > svn: No repository found in 'svn://blackiwid.dyndns.org/repos/trunk/gui' > > Ethan > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHKk4OhRlgoLPrRPwRAuJLAJ494/gF9TPcCMiLIz/Ux/H06uBIzQCg5zSG > LYwC6HhxP8gboxL0wEVpj2c= > =YUlc > -END PGP SIGNATURE- >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
you can get the source from svn://blackiwid.dyndns.org/repos/trunk/gui/lib/player/ or svn://blackiwid.dyndns.org/repos/trunk/gui/ for the hole game. its over my dsl-line, and i have some uploads running so i cant garant that it will go fast. but the player only code is small. there are the player-wrapper for pygame and other stuff, at the moment i try to debug so there is in head rev the hole initialising in load or in play not only in constructor. Hmm wenn i play the corruptet? (normal mp3file) file, it do like it would do, i get the prompt and can do other stuff, but no sound is comming. then when i play another file it hangs. with other files it works. i use that in the player code. pygame.mixer.pre_init(44100,-16,2, 1024 * 3) On 11/1/07, Ian Mallett <[EMAIL PROTECTED]> wrote: > On 11/1/07, Stefan Huchler <[EMAIL PROTECTED]> wrote: > > waiting 1 minute did not help ^^ ähh should i send you my example file? > Yep. > > 5,3 mb > That would do it. > > k i try to wait, but if that is loading why is the game crashing when > > i try to load another file oder play another? > Not sure. Perhaps the new file is loading over the first, and you get > some sort of segmentation fault when you try to play the old file. > Send me the code. > Ian >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
Hi, waiting 1 minute did not help ^^ ähh should i send you my example file? On 11/1/07, Stefan Huchler <[EMAIL PROTECTED]> wrote: > 5,3 mb > > k i try to wait, but if that is loading why is the game crashing when > i try to load another file oder play another? > > On 11/1/07, Ian Mallett <[EMAIL PROTECTED]> wrote: > > What size of files are you working with? .mp3 is a compressed file > > type. It takes a while to decompress sometimes, resulting in the > > program temporarily stalling. Larger files or files with more data > > will take longer. > > Ian > > >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
5,3 mb k i try to wait, but if that is loading why is the game crashing when i try to load another file oder play another? On 11/1/07, Ian Mallett <[EMAIL PROTECTED]> wrote: > What size of files are you working with? .mp3 is a compressed file > type. It takes a while to decompress sometimes, resulting in the > program temporarily stalling. Larger files or files with more data > will take longer. > Ian >
Re: [pygame] pygame hangs with some mp3 files and hangs the hole prozess
Hi, k sorry i copied wrong line for load, it was pygame.mixer.music.load('test.mp3') but the result are the what i said: 1 time sound is gone second time (any other file) and it hangs. I tryed it with some other files and there the code works, but with some mp3s that happens. I can live with it when pygame dont play all mp3s but it should not hang the prozess. On 11/1/07, Ian Mallett <[EMAIL PROTECTED]> wrote: > On 10/31/07, Stefan Huchler <[EMAIL PROTECTED]> wrote: > > > >>> import pygame > > >>> pygame.mixer.init() > > >>> pygame.mixer.load('test.mp3') > > >>> pygame.mixer.music.play() > > >>> pygame.mixer.music.play() > > > pygame.mixer.load() is not a function. You want: "Sound = > pygame.mixer.Sound(filename)" > You can't load .mp3 files with pygame.mixer. Only .ogg or .wav, or you can > use pygame.mixer.music. > Try this: > > import pygame > from pygame.locals import * > pygame.init() > TestSound = pygame.mixer.Sound("test.mp3") > TestSound.play() > > Ian > >
[pygame] pygame hangs with some mp3 files and hangs the hole prozess
Hi, i wrote it on irc but nobody was there. so i post it again here: >>> import pygame >>> pygame.mixer.init() >>> pygame.mixer.load('test.mp3') >>> pygame.mixer.music.play() >>> pygame.mixer.music.play() so i have some mp3 files with them pygame dies and when i play the next it hangs can i do there something? i wanted a preview song-playing function in my game the files play with mplayer or xmms can i reset pygame in such case or so i have a try catch around it and it does not go in catch i can send you the mp3 if that helps but i have some that hangs with pygame by the way if someone likes to test our game http://lobtoc.org/canta/ k i have the same results under gentoo and pygame with there versions. I dont hope that you get all this mp3s working soon it could be that there are buggy, but i hope there is a way that a buggy mp3 dont kill the hole prozess.