SOLVED: roAudioPlayer Buffering Delays for Http mp3 streams
So for anyone out there who was running into the problem of the audio player buffer buffering for a ridiculous ( over 5 secs) amount of time i found a solution i think.
basically, just after setting the roPlayer object to play -- then set a negative Seek in milliseconds , i used -180000 for - 3minutes thats a minus sign - not a dash
so i added the blablabla.Seek( -180000) to the files indicated below:
from the audioapp example file AudioPlayer.brs : ..... else if newstate = 2 then ' PLAYING if m.isplaystate = 0 m.audioPlayer.play() ' STOP->START m.audioPlayer.Seek(-180000) else .....
or if your are using the videoplayer example to play audio, in appDetailScreen.brs ( modified according to: viewtopic.php?p=352494 ) ..... else if button = AUDIO_BUTTON_PLAY() isPlaying = true isPaused = false audio.Play() audio.Seek(-180000) show.CurrentPosition = 0 zeroProgressBar(screen, show) .....
if anyone know a better way please let me know -- it took me forever to get anything going but this seems to work -- i was getting like 30-60 second delays and after unplugging my router with the stream playing noticed that it was playing for like 2 minutes -- maybe, roAudioPlayer saves the position in the stream at which you stopped and tries to get back to that position after you return to the same url ?
if this works for others maybe Roku folks would consider documenting
ps- im not a big forum poster guy so if this is not appropriate please inform me as such and direct accordingly, thx
Re: SOLVED: roAudioPlayer Buffering Delays for Http mp3 stre
Bless you! I don't know if this is the best first post ever, but it's certainly the most timely. I've been struggling with this problem the whole weekend. For me, it only happens once in a while and often goes away by itself, so it's very hard to try to find some workaround. I'll give this a shot and see how it goes.
It was definitely appropriate for you to post here. The only suggestion I'd make is that the next time you post code, enclose it in "code" tags, then you can get proper formatting and set your code off from the rest of your post:
else if button = AUDIO_BUTTON_PLAY() isPlaying = true isPaused = false audio.Play() audio.Seek(-180000) show.CurrentPosition = 0 zeroProgressBar(screen, show) end if
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution." If you appreciate my answer, maybe give me a Kudo.