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

Re: [pygame] File-like objects and mixer.Sound



> Furthermore, using pygame.image.load() with a StringIO file-like object
> seems to segfault as well :( 

hmm, now i'm starting to get a little worried.
there was also a bug in pygame-1.0 with loading from python objects
and running multiple python threads. but i'm guessing that's not
your problem? let's see if we can nail down what is and isn't
exactly working.

first, make sure you've got the latest cvs code, since i've
definitely done some work on the file-like loading since pygame-1.0

then try the following cases..

gfxname = 'sample.bmp'
sndname = 'sample.wav'

#first test a straight up file object
pygame.image.load(open(gfxname, 'rb'))

#then test a file-like object...
buffer = StringIO(open(gfxname, 'rb').read())
pygame.image.load(buffer)


#then do the same for sounds...
pygame.mixer.Sound(open(sndname, 'rb'))
buffer = StringIO(open(sndname, 'rb').read())
pygame.mixer.Sound(buffer)


try those 4 cases out, and see what does and doesn't fly.
if there are any problems, we've got to nail this down. what
platform and os are you running? this certainly should be
working for you, and it's been running ok with the limited
testing i've been running.






____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org