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

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



'Mailing list user' wrote about '[pygame] File-like objects and mixer.Sound' - Thu, May 17, 2001 at 06:29:58PM CEST
> I can't seem to get file-like objects (specifically StringIO) to
> work with pygame.mixer.Sound(). Transcript:
> 
> [ aquarius@giles ] ~/src/python/katalyst-player $ python2
> Python 2.0 (#0, Apr 14 2001, 21:24:22) 
> [GCC 2.95.3 20010219 (prerelease)] on linux2
> Type "copyright", "credits" or "license" for more information.
> >>> import pygame
> >>> import StringIO
> >>> import pygame.mixer
> >>> 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.

> >>> fobj = StringIO.StringIO(file)
> >>> pygame.init()
> (4, 0)
> >>> pygame.mixer.init()
> >>> snd = pygame.mixer.Sound(fobj)
> Fatal Python error: Segmentation Fault
> Aborted
> [ aquarius@giles ] ~/src/python/katalyst-player $ 
> 
> 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?

> 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.
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org