Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Kev
Newbie

Bookmark audio streams-Can it be done?

One word... AudioBooks; I have many, and I like the convenience of listening to them via Roku... except for the fact that if I don't listen to the entire recording in one sitting, I am stuck starting the file from the beginning each time - very annoying.
I've been searching for a Roku app with the "remember/resume", "fast-forward", and "fast-reverse" features for audio streams for some time without success. I am a retired IT professional so I downloaded the SDK and am considering building the app myself. I've been scouring the forum and, unless I'm missing something, have not found any discussions on the topic. I've run across the iTunes m4b format in my search - is this what I'm looking for or do I need to cobble together my own solution?
My vision is for a selection apart from Music, Video, and Photos called "Audio/Other" which would support the aforementioned enhancements and could be used for audio books, recorded radio broadcasts, taped lectures, etc. I would like to write/store the "bookmark" information to persistent storage on my laptop, making it available to any Roku device running the app on the network _unless_ that capability can be had by storing on the Roku itself.
I thought (PC+web server <-> Roku) may be viable as a personal channel solution.

Thanks in advance for any and all advice,
~Kev
0 Kudos
9 REPLIES 9
TheEndless
Channel Surfer

Re: Bookmark audio streams-Can it be done?

There's a reason you can't find any channels that do what you're wanting. The Roku SDK doesn't provide any method for seeking to a specific point in an MP3 file, hence the lack of a resume feature for audio in most channels.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
destruk
Streaming Star

Re: Bookmark audio streams-Can it be done?

Yeah, the best we've ever come up with for this is to either overlay the audio onto a static frame image and use videoplayer. The other option for podcasts that are 3+ hours long is to split the mp3 into sections of 30 minutes each, and then use a playlist and then you can resume from the last 'half hour block' that was played, skip to the next block, or rewind to the previous block, with buffering in between each change. The Component Reference does say there is a seek() function for the audio player, but it doesn't do anything...soo........
0 Kudos
Kev
Newbie

Re: Bookmark audio streams-Can it be done?

"TheEndless" wrote:
There's a reason you can't find any channels that do what you're wanting. The Roku SDK doesn't provide any method for seeking to a specific point in an MP3 file, hence the lack of a resume feature for audio in most channels.


"destruk" wrote:
... The Component Reference does say there is a seek() function for the audio player, but it doesn't do anything...soo........


Arrrrhg... Please post if you see the need for this functionality that I do. Maybe a show of hands will make a difference in the next release of the SDK. Perhaps it's already being considered? Could some from Roku comment on that please?

Thanks,
~K
0 Kudos
gonzotek
Visitor

Re: Bookmark audio streams-Can it be done?

"Kev" wrote:
"TheEndless" wrote:
There's a reason you can't find any channels that do what you're wanting. The Roku SDK doesn't provide any method for seeking to a specific point in an MP3 file, hence the lack of a resume feature for audio in most channels.


"destruk" wrote:
... The Component Reference does say there is a seek() function for the audio player, but it doesn't do anything...soo........


Arrrrhg... Please post if you see the need for this functionality that I do. Maybe a show of hands will make a difference in the next release of the SDK. Perhaps it's already being considered? Could some from Roku comment on that please?

Thanks,
~K
+1 🙂
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
RokuJoel
Binge Watcher

Re: Bookmark audio streams-Can it be done?

A developer came up with a method using roVideoScreen to bookmark mp3's, I haven't tested, but he claims it works:

viewtopic.php?f=34&t=39272&p=303484&hilit=roaudioplayer+seek%5D#p303484

Joel
0 Kudos
destruk
Streaming Star

Re: Bookmark audio streams-Can it be done?

quoted from linked thread:
My last option was to switch to a roVideoScreen just to play mp3 files. Unfortunately I discovered some of the same issues with roVideoScreen. While it did provide the playback position notification and eliminated the need to use roTimespan/wait I still couldn't resume at a specific position. Calling Seek() prior to or after calling Show() had no effect, calling Seek() from the isStreamStarted() notification had no effect, and the PlayStart and StreamStartTimeOffset meta-data attributes were ignored for mp3 files. The ONLY way I was able to resume playback at a specific position was with the code below.


resume = 100
currentpos = 0
isResumed = false
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
if msg.isPlaybackPosition() then
currentpos = msg.GetIndex()
print "playback position: "; currentpos
if not isResumed and resume > 0 then
isResumed = true
player.Seek((resume + 1) * 1000)
endif
endif
endif
end while


So to use this, I supposed the resume variable at the top is the number of seconds in to resume, and then you need to hope that an mp3 file will play with no video data available in the stream using the roVideoScreen component.
I haven't tried this. Can anyone confirm it does work on roku1 and roku2?
0 Kudos
TheEndless
Channel Surfer

Re: Bookmark audio streams-Can it be done?

"destruk" wrote:
So to use this, I supposed the resume variable at the top is the number of seconds in to resume, and then you need to hope that an mp3 file will play with no video data available in the stream using the roVideoScreen component.
I haven't tried this. Can anyone confirm it does work on roku1 and roku2?

He's using an roVideoScreen, which means he's blocking all UI execution with a black video screen while he's playing his audio. I'd be very interested in knowing if this works with the roVideoPlayer component as well, which could be hidden during playback.

Bizarre that Seek() would only work after receiving an isPlaybackPosition() event. Maybe by then, it's had time to calculate the stream length, so it has enough information to guess at the offset, whereas prior to play it doesn't. If that's the case, maybe delaying the seek until after playback starts would also work with the roAudioPlayer.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
renojim
Community Streaming Expert

Re: Bookmark audio streams-Can it be done?

"TheEndless" wrote:
If that's the case, maybe delaying the seek until after playback starts would also work with the roAudioPlayer.

I seem to recall trying to use the FF button to move forward 10 seconds a click after playback started when seek first appeared and it didn't work. If I remember correctly, it did move, but a random amount. Of course that was long ago and I may not be remembering everything correctly.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
greubel
Visitor

Re: Bookmark audio streams-Can it be done?

Give Chaneru Rev2 or 2.0 version 2.0.13 a look. If you are on 5.x Roku release and use mp3 files, you can pause and resume.
Chaneru should keep track of where you are and you could actually switch to a different Roku box.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.