Forum Discussion

jbrave's avatar
jbrave
Channel Surfer
15 years ago

Springboard Progress Indicator questions

There seems to be a method for setting the progress indicator's position in an audio player Springboard. How do we find out the position in the audio file in order to update this?

Also, is there any way to create a custom progress indicator image using images retrieved over the network?

Thanks,

- Joel

6 Replies

  • It's been a while since i've done brightscript coding, but from what I remember, there is a setting for the track length on the audio player screen that you can set. That and linking the audio player to the audio screen and then the system takes care of the progress indicator for you.
  • "jbrave" wrote:
    Also, is there any way to create a custom progress indicator image using images retrieved over the network?


    You could do that with roImageCanvas and build your own audio screen rather than use a roSpringboardScreen. The customvideoplayer sample uses that approach for a video screen.
  • jbrave's avatar
    jbrave
    Channel Surfer


    You could do that with roImageCanvas and build your own audio screen rather than use a roSpringboardScreen. The customvideoplayer sample uses that approach for a video screen.


    Well, that might work, but there is still a question of getting the index to the actual location in the song. In the springboard even, I don't see how knowing the length of the track gives you an accurate index to the song position since there are unknown delays in requesting and retrieving, not to mention decoding the mp3 file...

    Any further info would be helpful.

    Thanks,

    - Joel
  • "jbrave" wrote:
    I don't see how knowing the length of the track gives you an accurate index to the song position since there are unknown delays in requesting and retrieving, not to mention decoding the mp3 file...


    roAudioPlayer generates a "start of play" event when the initial buffer completes and the audio starts playing, that would be your zero mark. From there you can trigger the wait() function once per second and increment a counter to know where in the audio you are. This thread may be helpful viewtopic.php?f=34&t=26345
  • "RokuChris" wrote:
    roAudioPlayer generates a "start of play" event when the initial buffer completes and the audio starts playing, that would be your zero mark. From there you can trigger the wait() function once per second and increment a counter to know where in the audio you are. This thread may be helpful viewtopic.php?f=34&t=26345

    For what it's worth, I've found that audio playback actually starts well before the "start of play" event. You're results may be different, but I've found that there's 13% buffering, then a isListItemSelected() event, at which point audio playback starts, then the remainder of the buffering, and then the "start of play" event.

    You may also want to user a timer and Mark() it when playback starts rather than rely on the 1000ms wait timeout. Again, that's up to your preference, but I found that to be a little more reliable.
  • Unfortunately, we don't yet have audio progress events.... So the progress bar must be updated by getting the duration of the song from your feed and tracking time via your event loop (a wait timeout of 1 sec is a good update interval) and using roDateTime for an accurate assessment of elapsed time.

    --Kevin