alex_h
October 4th, 2007, 04:21 AM
I'm working on an online audio player that plays streaming mp3s. I have a combined download progress and playback progress display. The download progress element works fine using Sound.bytesLoaded / Sound.bytesTotal as normal. I want to use SoundChannel.position and Sound.length in a similar way in order to display the current playback position within the song. However, although this works fine when testing locally(since the entire mp3 is buffered more or less immediately), as soon as I run it over http I have a problem, because the value returned by Sound.length appears to be dependent on how much of the file has currently downloaded. Since it takes some time for the file to download, I end up with a steadily increasing value being returned by Sound.length, which screws up my progress display.
Can anyone suggest an effective workaround for this? Or am I missing something really obvious... ;)
cheers,
Alex H
Can anyone suggest an effective workaround for this? Or am I missing something really obvious... ;)
cheers,
Alex H