Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 8

Audio Player - Very Long Load Time

I am working on an application that plays streaming audio using the roAudioPlayer object. When I execute the play() method, it takes a very long time to start playing the stream. The last test I ran took a total of 99 seconds from the time play() was executed until audio was heard (and the "start of play" status message was received). This problem is not limited to one specific audio stream.

If I reboot my box, this issue goes away and audio begins playing immediately. But, over time, the problem returns and it takes over a minute for audio to start playing.

The streams, which are just Shoutcast streams, play immediately on my PC and on a Roku SoundBridge that I frequently use.

This is occurring on a Roku 2 XS running version 5.1 of the firmware.

Any thoughts as to what might be the problem?

0 Kudos
Level 9

Re: Audio Player - Very Long Load Time


I have exactly the same problem and I have no idea why.

I have an audio stream running on a CentovaCast server. When that audio stream is loaded into anything, it plays immediately....load it on the Roku and it takes an age to fire up.

It doesn't appear to happen with other streams, but I do not know what is behind those streams.

I'm wondering if its a remote issue but how to find out what is causing it, anyone have any ideas?

Welcome anyone's input!
0 Kudos
Level 9

Re: Audio Player - Very Long Load Time

It appears to be a long-standing bug in roAudioPlayer. I've played around with various workarounds. What I'm currently doing is when I get the audio player's IsStreamStarted event, Pause then Resume the audio player, giving it a little Sleep time to think about it. It seems to work about 98% of the time. Something like this:

Sleep (350)
audio.Pause ()
Sleep (350)
audio.Resume ()

It doesn't seem very effective on the 3.1 firmware though. It still takes a while to buffer in that case. However, I'll change the text on the roSpringboardScreen's Play/Pause/Resume button to display a percentage showing how much buffering has been done, in response to the IsStatusMessage "startup progress" message so the user knows something is really happening (albeit slowly) rather than the channel having hung. I know this works on the Roku 2XS. I don't have a Roku 3, so I've no idea how it works (or if it's necessary) on that unit.
0 Kudos
Level 7

Re: Audio Player - Very Long Load Time

As a followup to @belltown's post, they also posted something about playing audio using the videoplayer instead. I accidentally stumbled on this when developing a channel and found that there were no buffering issues. This may not be ideal for some developers who are doing Audio only. I will also say I'm not a seasoned developer and may be missing something in my tests so it may be possible to make that meet your needs for Audio only. You can read the rest of my post about this here.


You can find @belltown's post about using the videoplayer there or directly here.

0 Kudos