[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] How to check sound format of mixer?



On, Tue Feb 19, 2008, Marcus von Appen wrote:

> On, Tue Feb 19, 2008, Lenard Lindstrom wrote:

[...]
> > 
> > Traceback (most recent call last):
> >  File "sound.py", line 21, in <module>
> >    sound = mixer.Sound(file)
> > TypeError: expected a readable buffer object
> 
> Sure, because file() and open() return file objects, not buffers. The
> Python File object do not implement a buffer interface, but you can
> easily help yourself using
> 
> fp = open (your_file)
> sound = pygame.mixer.Sound ((buffer(fp.read ())))
> 

Drop the above rubbish, now I get what I messed up. I'll fix it
instantly.

Regards
Marcus

Attachment: pgpmj0tVzd6UN.pgp
Description: PGP signature