At 9:25 AM +0100 11/27/01, Natalia Tjelum wrote:
>Carl West wrote:
>I _think_ she's using the sort of number notation where you find '.'s
>where Americans put ','s and actually wants to play the last 10 seconds
>of the sound.
>-----------
>
>Haha, no that's not it. I do know the difference from '.' and ','
>I am working on an audio player with a graphical indicator showing how much
>of the track has played. I get an error when I pull my indicator to a few
>pixels from the end. It is not that much of a problem, now I simply end the
>track playing, and play the next in my play list, but it puzzled me, why
>this problem occurred.

Aha!

So you're grabbing the slider's pixel position & using that to map 
back to the position within the sound?
You're probably getting rounding error (I did).

The solution that I have found in this situation is to always get the 
slider position as a percentage of it's total available travel and 
the then set the sound position as this percentage of the duration. 
Then you are guaranteed that all pixel positions will map within the 
duration.  Also you should special-case the 100% situation, since you 
can't play from #startTime = .duration anyway.

hth

-Buzz


>Anyway, thanks all, the key frames thing made sense.
>
>-Natalia
>
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/lingo-l.cgi  To post messages to the list,
>email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo.  Thanks!]


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to