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

[pygame] seeking in a .WAV with pygame.mixer.music? and "pynudge"



I wrote a program with pygame that lets the user
record beat markings while a song plays, so that an
exact beat for songs recorded without stable
timekeeping can be used in music games such as
Stepmania.

The first version of this worked reasonably well - I
slowed down the music to around 70-80% speed first
with Audacity, then ran the program with the slowed
down file. The timings were multiplied back to normal
and converted to BPMs, and the song played well
in-game - except for the parts where I made mistakes
recording, and how note movement would slow and speed
up with each beat. (the latter being more of a game
problem than my problem)

For the revamped second version, "pynudge," I'm giving
visual indication of the beats like in an actual music
game, and making it so that you can nudge around each
beat manually and re-record sections. Things have gone
well so far, but the latter parts of nudging and
re-recording require me to start the song in the
middle.

The problem I've encountered in doing this is that
pygame(and possibly SDL_mixer) doesn't let you use the
play function's startpos parameter with a .WAV file.
It's apparently unsupported. I'll admit that I haven't
tried loading an MP3 or OGG yet, which the
documentation says is explicitly supported.....but
even if that works it seems like a pretty arbitrary
restriction; it would force me to re-encode my
slowed-down song again.

I've looked at pymedia as well, but I don't see a
tutorial or code for it that says "this is exactly how
you seek through some audio."


		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html