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

[pygame] Re: seeking in audio files



florian <florian@structbench.com> wrote:
> i've heard that the mixer.music module is the best one too do something
> like mp3 or ogg playback..
> 
> im wondering how ever if there is no way to seek in a song? is
> there? like to jump to the position 1 min and 12 seconds for example..

in the latest version of pygame (v1.5) you can specify a starting 
position when playing music. (this also requires a recent SDL_mixer)

     pygame.mixer.music.play(loops=0, startpos=0.0) -> None
     http://www.pygame.org/docs/ref/pygame_mixer_music.html#play

the starting time works as "seconds" for OGG and MP3. to start at 
1:12 you would call something like this...

     pygame.mixer.music.play(0, 1 + (12 / 60.0))




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