I can emulate the timing feedback using pygame.time.get_ticks and an offset when the song starts, but I'll need to work around not being able to start playing the song at an arbitrary number of milliseconds. I'm making a rhythm/combat/platformer, so the music and gameplay are closely tied. The biggest problem with losing the ability to start the music any place is that there is going to be desynchronization if the player happens to repeatedly pause the game.
Each time the player pauses, a few milliseconds will slip by between pausing/resuming the music and recalculating the tick offset, regardless of what order I perform the two in. Eventually the music will desynchronize from the game. Can anyone think of a way to keep the music in sync through multiple pauses without either: 1.) allowing the music to play while paused or 2.) restarting the music on unpause. The music has to stop and resume exactly where it left off or else just the act of pausing affects gameplay. If the number of milliseconds that I think the song has been playing don't match the actual number, then the gameplay falls apart.
Thanks, -Zack On May 25, 2009, at 12:36 AM, René Dudfield wrote:
hi As Brian says, maybe loading multiple oggs as Sound objects would work for you, if you don't need streaming. if not, maybe this will be good for you (allthough it doesn't currently support oggs): http://code.google.com/p/pygalaxy/wiki/SWMixer It uses pyaudio (a python wrapper for portaudio) and some code to emulate the pygame.mixer interface (although not exactly). Also not sure if Nathan is working on it anymore. Maybe it'd be useful for you. cu, On Mon, May 25, 2009 at 9:39 AM, Zack Schilling <zack.schilling@xxxxxxxxx> wrote:I'm looking for something a little more complex than the pygame- wrapped SDLmusic mixer to use with my pygame project. I need something that'scross-platform (Mac OS X, Windows, Linux), easy-to-use, and supports thefollowing features: 2+ tracks simultaneously Streaming ogg playback Seamless looping Gapless playback Fade in/out Precise timing info (like the way the SDL reports playback time in milliseconds )Any suggestions for what I could use? How does Frets on Fire work? Whateverthey use seems ideal in terms of features. Thanks, -Zack