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

Re: [pygame] Fwd: Multiple Music Files



Pete Shinners wrote:
> I'm playing around with porting an existing game to PyGame.  The 
> existing game has music in a largish number of individual MIDI files, 
> which get played contiguously.  In the existing game, the next MIDI file 
> is preloaded before the current one is finished, so there is no latency 
> between one ending and the next beginning; however, it doesn't seem to 
> work that way in PyGame.
> 
> Looking at the SDL mixer docs, it doesn't seem to be a restriction 
> there, since music gets loaded into its own "handle".  Is there a reason 
> that PyGame couldn't support this?
> 
> Thanks.


well, this was a design decision in pygame (hopefully for the 
better). since SDL_mixer only supports a single playing music 
channel, i designed the 'music object' to work more like a singleton 
object (meaning there is always only one)

my big question is, are you getting a delay between midi tracks? i 
was pretty sure the midi is "streamed" as it plays, so there 
shouldn't be any loading time? perhaps this is not the case? are you 
on windows i wonder? on windows SDL now uses 'native' midi plaback, 
but i was under the impression it was still streamed.. perhaps not?

if you really are getting a delay between songs, i have no problem 
adding some kind of workaround. it would probably be along the lines 
of "music.queue(next_song)", which would automatically play when the 
current song ends (plus preload it so there's no delay)

(actually, someone has already asked for this sort of thing for 
regular Sound and Channel objects, so maybe it's time to get it in)

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