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

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



In article <20010517184717.A13274@rhudaur.be.qahwah.net> you wrote:
>> >>> file = open("/home/aquarius/misc/sounds/newmail/sensemail.wav").readlines()
> 
> now your 'file' contains a list of lines, I doubt that that
> is what you want.

Well, OK. However, using read() instead of readlines() doesn't solve
the problem, so that's not it. Moreover, the code I showed above is
only an example of code that crashes pygame. The way I discovered the
code was by trying to use mixer.Sound() on a StringIO object that I'd
populated from one long string.
 
>> >>> fobj = StringIO.StringIO(file)
>> >>> pygame.init()
>> (4, 0)
>> >>> pygame.mixer.init()
>> >>> snd = pygame.mixer.Sound(fobj)
>> Fatal Python error: Segmentation Fault
>> Aborted
>> 
>> I'm not sure what's supposed to happen here, or whether I'm doing
>> something wrong, but I *am* sure that it's not supposed to segfault,
>> it's supposed to give me a traceback :) Any suggestions? I'm
> 
> If the program crashes in the SDL library, or in pygame's
> C-code, it will crash, right?

This is true, I admit. Nevertheless, I don't know what the problem is,
and I can't work out how to find out :) I've tried stracing python, but
it doesn't give me any obvious clues -- this being said, though, I'm
not a particularly great low-level coder, so straces don't always help
me...
 
>> using the Debian pygame 1.0 package on a Debian woody system -- I
>> can provide other version numbers or whatever on request.
>> 
> I don't find pygame in my debian sid, I build from source.

It's not an official package in the distribution. You can grab Francis'
.debs from www.pygame.org and install with dpkg -i, though, and I
always think that that's nicer than building from source :)

Aq.

-- 
A man, a plan, a canoe, pasta, heros, rajahs, a coloratura, maps,
snipe, percale, macaroni, a gag, a banana bag, a tan, a tag, a banana
bag again (or a camel), a crepe, pins, Spam, a rut, a Rolo, cash, a
jar, sore hats, a peon, a canal -- Panama!
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org