[pygame] Problem with get_length and mp3

2008-06-20 Thread Stefan Huchler
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


Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread Peter Gebauer
Hi again!

I've tried compiling what you've submitted so far, it fails with many 
errors. For instance, what's with the double typedef's? Are you still just 
prototyping?

Also, I'm writing cmake build scripts to test your code, is anybody else 
interrested in this or should I use whatever PyGame is using? What is the 
preferred way of building?

/Peter

 Hi,

   In fact, just as I said before, all data structures of this engine are 
 based on python basic type data structures. 2d vector type is just same as 
 complex type in concept and C implementation, so I just use Python complex 
 type and add some functions for advanced vector usages. I think maybe it's 
 not a bad idea to treat physics 2d vector space as complex number space. But 
 I also separate the main code from vector code, replacing it with a distinct 
 vector type will be easy, maybe it will support it after the first stable 
 release.

   Best Wishes
   Zhang Fan
   


[pygame] {ANN] Pygame 1.8.1pre (SVN 1376) Windows installers for Pygame and Documents

2008-06-20 Thread Lenard Lindstrom
I have updated the Windows installers on my site for Pygame 1.8.1 
pre-release (SVN 1376). This version passes all unit tests so far. I 
have also updated the documents and examples installer and bundle. 
Everything can be found at http://www3.telus.net/len_l/pygame/ .


md5 sums:
0dc5d7b44868151939c4265f9daacb4c *pygame-1.8.1a0.win32-py2.4.msi

17bfbec6ed6f2cbb47de28b1697561c7 *pygame-1.8.1a0.win32-py2.5.msi

e3f34c47bdbc05a0c89d9291e5e1d6b9 *pygame-1.8-docs-and-examples.tar.gz

0b4e147125ece2efbbd0223d6a7cc71f *pygame-1.8-docs-setup.exe

--
Lenard Lindstrom
[EMAIL PROTECTED]



Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread Marcus von Appen
On, Fri Jun 20, 2008, Peter Gebauer wrote:

 Hi again!
 
 I've tried compiling what you've submitted so far, it fails with many 
 errors. For instance, what's with the double typedef's? Are you still just 
 prototyping?
 
 Also, I'm writing cmake build scripts to test your code, is anybody else 
 interrested in this or should I use whatever PyGame is using? What is the 
 preferred way of building?
 
 /Peter

Currently there's only a VisualStudio project available. We worked out a
set of patches for the typical python way, which did not yet make its
way into SVN. Expect it to be available soon.

Regards
Marcus


pgpdZk4PLWDu5.pgp
Description: PGP signature


Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread Jake b
Zhang: What font do I need to view your name? [ I'm using winXP, firefox3
and it's showing as 0x5e06 0x5f20 ]

2008/6/19 帆 张 [EMAIL PROTECTED]:

 Hi,

 In fact, just as I said before, all data structures of this engine are
 based on python basic type data structures. 2d vector type is just same as
 complex type in concept and C implementation, so I just use Python complex
 type and add some functions for advanced vector usages. I think maybe it's
 not a bad idea to treat physics 2d vector space as complex number space. But
 I also separate the main code from vector code, replacing it with a distinct
 vector type will be easy, maybe it will support it after the first stable
 release.

 Best Wishes
 Zhang Fan

Here's a vector2 class: http://partiallydisassembled.net/euclid/index.html


 *Lenard Lindstrom [EMAIL PROTECTED]* 写道:

 Hi,

 I had a quick look at the vector code in SVN. I see that the glVector2d
 is just a Python complex type. Is this simply for prototyping? Will the
 finished module support a distinct vector type?

 Lenard



 帆 张 wrote:
  Hi ,
  Thank you very much, I'd like to see your advices and get help from
  you. I also want to tell the difference between chipmunk(and Pymunk)
  and this project, this one is not separated with python, all of its
  basic data structures are based on python data structures, which means
  it can be integrated in python seamlessly . Also some classes are
  targeted to integrate physics updating and pygame sprite rendering,
  which means user can write their physics games more easily.
  API defines and my working progress are on my yahoo blog:
  http://i.cn.yahoo.com/zhangfanfox/blog/ , and current working code is
  on a branch of pygame svn: _svn://seul.org/svn/pygame/branches/physics _
  Best wishes
  Zhang Fan
 
  */Peter Gebauer /* 写道:
 
  Hi!
 
  I read Zhang Fan's post regarding his gsoc project, I've been
  looking to do
  something similar, a Python extension for an already existing library.
  So far I've extended Chipmunk partially over a few days of
  prototyping, but
  there's no point in having two projects doing the same thing, I'd
  like to
  know a bit bout the plans of the physics module for PyGame. (if
  you're
  reading this, Zhang)
  I could also help out with some testing/patching for the C Python
  stuff.
 


 --
 雅虎邮箱,您的终生邮箱! http://cn.mail.yahoo.com/




-- 
Jake


Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread Marcus von Appen
On, Fri Jun 20, 2008, Jake b wrote:

 Zhang: What font do I need to view your name? [ I'm using winXP, firefox3
 and it's showing as 0x5e06 0x5f20 ]

Go to the control panel - region and language settings and check the
support for east asian languages option (on the second register, I
think). This will install the necessary fonts and libraries you need to
display east asian characters and scripts.

Regards
Marcus


pgpRnyIGayO4G.pgp
Description: PGP signature


Re: [pygame] Problem with get_length and mp3

2008-06-20 Thread René Dudfield
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 [EMAIL PROTECTED] 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



Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread Richard Jones
On Thu, 19 Jun 2008, Peter Gebauer wrote:
 I read Zhang Fan's post regarding his gsoc project, I've been looking to do
 something similar, a Python extension for an already existing library.
 So far I've extended Chipmunk partially over a few days of prototyping, but
 there's no point in having two projects doing the same thing

You might well think that... http://code.google.com/p/pymunk/


   Richard


Re: [pygame] The gsoc project physics engine.

2008-06-20 Thread René Dudfield
# hello.
#
# I've prepared a set of python computer instructions for your consideration.
# Warning: Not safe for work! But it's the weekend, so that doesn't matter.
#  TODO: these computer instructions could be optimised.Only achieves 0.5 fps.

def inately__for_your_consideration():
# a quote from previous email explaining why.
reasons_from_other_email = 
As you can see from Zhang's post there's a difference between making soft
bindings using ctypes and hard bindings using the Python C API.
While ctypes is convenient to use and easy to modify since only Python code
is involved, it lacks the ability to let the programmer to extend Python
using the underlying C API directly. It also lacks the ability to
intergrate easy with other Python extensions. It's also a matter of speed,
in particular when it comes to iterations, like for collision testing and
drawing many objects. If this can all be done in C we are better off.
.replace(42, meaning of life).split(\n)
return reasons_from_other_email
import pygame;from pygame.locals import *;pygame.init()
screen = pygame.display.set_mode((640,200))
pygame.display.set_caption(for your consideration)
f = pygame.font.Font(None, 24);c = pygame.time.Clock();fps = 0.5
while not filter(lambda x:x.type in [QUIT,KEYDOWN],pygame.event.get()):
for i, message in enumerate(inately__for_your_consideration()):
screen.blit(f.render(message,1,(min((i*5)+50,255),
 79,
  min((i*10)+50,255))),
   (10+i*3,i*26));
pygame.display.flip();screen.fill((0,0,0));c.tick(fps)


#cheers,





On Sat, Jun 21, 2008 at 11:43 AM, Richard Jones
[EMAIL PROTECTED] wrote:
 On Thu, 19 Jun 2008, Peter Gebauer wrote:
 I read Zhang Fan's post regarding his gsoc project, I've been looking to do
 something similar, a Python extension for an already existing library.
 So far I've extended Chipmunk partially over a few days of prototyping, but
 there's no point in having two projects doing the same thing

 You might well think that... http://code.google.com/p/pymunk/


   Richard



[pygame] Tests crashing Automatic Build page + Compiling PyGame on Windows

2008-06-20 Thread Nicholas Dudfield

Greetings all.

Computer Died
=

My computer recently decided it needed to go into early retirement and I 
have been forced to use my friends old Windows box when able. He has 
alot of assignments at the moment and I can only really use it while 
he's at school. My computer should be back in operation in a few days 
hopefully when a replacement cooling fan arrives.


As I am on Windows I need to get access to binaries of the pygame svn 
HEAD. This is normally no trouble as the automatic build page usually 
has them posted. Lately though, some surface lock tests are crashing the 
build script. The windows builds crashed a few revisions ago so I 
decided to compile from source.


Compiling Pygame


The instructions for building pygame on windows using MSYS involved 
downloading and compiling dependencies. It was not until afterwards that 
I found out that prebuilts were available. It would probably be helpful 
to link to them somewhere on the wiki. It was not until afterwards that 
I found out that prebuilts were available. I will do that myself once my 
computer is operational again. In fact there is a note on the wiki, 
*note* We should have a download with everything included. As well as 
patches for each one that we need. 


Anyway, I went to the pains of downloading all the dependencies and 
compiling. The msys_build_deps.py script works very nicely, the only 
issue I had was that SMPEG wouldn't compile. I just got a copy of the 
config and dll from the page with the prebuilts.


This was the error message from the script:

$ msys_build_deps.py SMPEG

=== Starting build ===
aclocal: configure.in: 133: macro `AM_PATH_SDL' not found in library
aclocal: configure.in: 219: macro `AM_PATH_GTK' not found in library
'./autogen.sh' failed to run properly
Build aborted: The build for SMPEG failed with code 1

Failing Tests
=

I built revision 1376 and running run_tests.py here crashes before 
completion of all the tests. I traced it to surflock_test.py.
I renamed it temporarily so it wouldn't be picked up by run_tests.py and 
then the suite ran to completion, showing failures in transform_test.py. 
Bizarrely, I ran that test discretely and it passed.


I think surflock_test.py crashed the automated builds for 
http://thorbrian.com/pygame/builds.php


I saw that builds for revision 1376 were recently posted to the list 
with a note saying it passed all unit tests. I downloaded it, removed my 
existing pygame install, deleting the whole pygame folder, and installed 
it. Same surflock_test.py crash, same transform_test.py failures and errors.


The surflock_test.py crash actually stalls the test suite and it reports 
nothing; no F, E or OK.


D:\Nick\PyGame\trunkrun_tests.py
loading base_test
loading blit_test
loading color_test
loading display_test
loading font_test
loading image_test
loading image__save_gl_surface_test
loading key_test
loading mask_test
loading mixer_test
loading movie_test
loading pixelarray_test
loading rect_test
loading sndarray_test
loading sprite_test
loading surface_test
loading surfarray_test
loading surflock_test
loading transform_test



..

We need to make the build page + test runner more resistant to tests 
that will possibly crash everything.


Cheers,

Akalias.

ps. Sorry in anticipation of being late in replying to replies.



Re: [pygame] {ANN] Pygame 1.8.1pre (SVN 1376) Windows installers for Pygame and Documents

2008-06-20 Thread Nicholas Dudfield

Lenard,

see post re: Tests crashing Automatic Build page + Compiling PyGame on 
Windows


The build posted is failing tests here. Can you confirm everything is 
OK your end?


I suspect you are getting a false pass due to a buggy test crashing the 
test runner.


Cheers.
I have updated the Windows installers on my site for Pygame 1.8.1 
pre-release (SVN 1376). This version passes all unit tests so far. I 
have also updated the documents and examples installer and bundle. 
Everything can be found at http://www3.telus.net/len_l/pygame/ .


md5 sums:
0dc5d7b44868151939c4265f9daacb4c *pygame-1.8.1a0.win32-py2.4.msi

17bfbec6ed6f2cbb47de28b1697561c7 *pygame-1.8.1a0.win32-py2.5.msi

e3f34c47bdbc05a0c89d9291e5e1d6b9 *pygame-1.8-docs-and-examples.tar.gz

0b4e147125ece2efbbd0223d6a7cc71f *pygame-1.8-docs-setup.exe