I'm pretty new to Java and GUI programming, so I have been looking at Swing for GUI programming and I have been looking at javazoom's projects for audio references. I'm currently working on creating a progress/seek bar in Swing however I'm not really sure what I should set the max value at for the slider, should it be in the AudioInputStream's available() method's byte number return when the stream is first returned (before anything is read) or should it be something else? Also how often should the slider update...ever time I read a new byte array into the dataLine/sourceLine from the input stream?

11 Years
Discussion Span
Last Post by jwenting

The total data size is a good number, or take an estimate of the total time needed.
How often you update is up to you, after each Xth read operation would be good (where X is a number you decide on based on performance).
Updating after every read might cause too great a performance hit but you could start with that and then reduce the update frequency until everything seems to perform nicely and still not be jerky.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.