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

[pygame] mp3 and pygame.mixer



Hello,
I try to play a MP3 file from pygame.mixer (*not* pygame.mixer.music). I need to do so because here what I need to do in fact :


I have the sound data in a the variable data.
I do :

fobject = cStringIO.StringIO(data)
pygame.mixer.init()
snd = pygame.mixer.Sound(fobject)
snd.play()

'data' is extracted from a specific file format that serves as agregation (a bit like tar file) nad I'd like not to write down data on a file on the only purpose to be able to play it. So I really need to use pygame.mixer, and not pygame.mixer.music

Is there a way to do it?

Mickaël