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

Re: [pygame] No pygame.mixer.Sound.get_current()?



Hello,

It's impossible to get this information accurately in a portable way.
Because of various buffers, you can't actually be sure how much sound
has come out of the speakers.  You can sometimes figure this out on
specific machines though.

However you can guess by how long your sound has been playing.  You'll
need to store the time yourself when you tell it to play, then compare
it to the current time.

cu,


On Thu, Jul 31, 2008 at 11:10 AM, Tyler Distad <tyler.distad@xxxxxxxxx> wrote:
>> There is no function that does this, but if there was it would be in
>> pygame.mixer.Channel.
>>
>> Sounds are immutable. They each just the data of the sound.
>
> Thanks for explaining what the Sounds are as compared to Channels.
>
>> Also, pygame.mixer.music has functions for getting the position and seeking.
>
> The problem with the pygame.mixer.music module is that it's a "special
> streaming channel." There is no way to find the end of the song. It
> can tell the position, but I need both position and length. Also, I
> cannot find any functions in pygame.mixer.music for seeking. The
> almost complete lack of documentation on the module does not help,
> either.
>