# audio roSpringBoardScreen progress indicator

**URL:** <https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792>\
**Category:** Archived\
**Tags:** roku-developer-program\
**Created:** [March 1, 2010, 4:24am UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792 "2010-03-01T04:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrager](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@scrager](https://forum.developer.roku.com/u/scrager)\
**Post date:** [March 1, 2010, 4:24am UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792/1 "2010-03-01T04:24:01Z")

</div>

Is it possible to sync the progress indicator on a spring board screen to a playing audio player automatically?

If not, I assume that in the while loop that waits for events, the wait command needs to wait for a period of time, not 0. On each loop, calculate the time played and adjust the progress indicator accordingly.

So i tried that, but I am not sure of a good way to calculate time. I tried this:

```auto

playstart = uptime(0)
maxplay = 190

while true
   msg = wait(1000,port)

   ....

   playtime = uptime(0) - playstart
  screen.setprogressindicator(int(playtime),maxplay)

end while

```

but uptime does not seem to count in seconds even though the documentation says it does. it seems to count 1/10 second for every real second, but it is not consistent.

So is my calculation wrong? Is there a better way to calculate time or am I going about this wrong? I did not see any progress indicators in any of the sample code.

---

<div class="post-metadata">

**Author:** ![scrager](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@scrager](https://forum.developer.roku.com/u/scrager)\
**Post date:** [March 1, 2010, 4:47am UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792/2 "2010-03-01T04:47:36Z")

</div>

I found the roDateTime object that seems to work a lot better than uptime

I’d still like to know if it is possible to sync a springboard screen to a player to have the progress indicator updated automatically.

---

<div class="post-metadata">

**Author:** ![evilmax17](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@evilmax17](https://forum.developer.roku.com/u/evilmax17)\
**Post date:** [December 13, 2010, 2:02am UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792/3 "2010-12-13T02:02:02Z")

</div>

Bump.

Are there best practices for keeping track of audio progress? None of the examples in the SDK use SetProgressIndicator.

---

<div class="post-metadata">

**Author:** ![RokuKevin](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@RokuKevin](https://forum.developer.roku.com/u/RokuKevin)\
**Post date:** [December 13, 2010, 8:19pm UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792/4 "2010-12-13T20:19:51Z")

</div>

Greubel’s example is the best way to do it currently. The Roku does not send audio progress events, so you must keep track of the time in your app.

–Kevin

---

<div class="post-metadata">

**Author:** ![TheEndless](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@TheEndless](https://forum.developer.roku.com/u/TheEndless)\
**Post date:** [December 13, 2010, 8:51pm UTC](https://forum.developer.roku.com/t/audio-rospringboardscreen-progress-indicator/792/5 "2010-12-13T20:51:33Z")

</div>

gruebel’s example looks like it will get out of sync if the wait loop receives any valid messages. As scrager suggested, I’d recommend using an roDateTime object for better accuracy.

I do something like this…

```auto
content = { mycontent }

playbackTimer = CreateObject( "roDateTime" )
isPlaying = False
isPaused = False
isBuffering = False

content.CurrentPosition = 0
audioPlayer.SetContentList( [content] )
audioPlayer.Play()
While True
	msg = Wait( 1000, audioPlayer.GetMessagePort() )
	If msg <> invalid Then
		If msg.IsRequestFailed() Or msg.IsPartialResult() Or msg.IsFullResult()Then
			isBuffering = False
			isPlaying = False
			Exit While
		Else If msg.IsPaused() Then
			' We paused, so record the current playback timer position
			content.CurrentPosition = content.CurrentPosition + playbackTimer.TotalSeconds()
			isPlaying = False
			isPaused = True
		Else If msg.IsResumed() Then
			' We resumed, so restart the playback timer
			m.PlaybackTimer.Mark()
			isPlaying = True
			isPaused = False
		Else If msg.IsStatusMessage() Then
			If msg.GetMessage() = "startup progress" Then
				isBuffering = True
				' Show buffering message here
				' Should also reset playback timer if isPlaying = True
			Else If msg.GetMessage() = "start of play" Then
				' Start the playback timer
				playbackTimer.Mark()
				isPlaying = True
				isBuffering = False
			End If	
		End If
	End If
End While

```
