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: 
nowhereman
Visitor

roAudioPlayer.Seek()

Has anyone had success using roAudioPlayer's Seek() function? I expected it to work similarly to roVideoPlayer's Seek(), but that doesn't seem to be the case. No matter what offset value I send it; positive numbers, negative numbers, zero; it always seeks forward a few seconds.
twitter:nowhereman
http://www.thenowhereman.com/roku
http://www.thenowhereman.com/netflix
0 Kudos
8 REPLIES 8
renojim
Community Streaming Expert

Re: roAudioPlayer.Seek()

I've had the same results as you. I even created an mp3 of me counting 1 number per second and the time it seeks seems to be totally random.

-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
nowhereman
Visitor

Re: roAudioPlayer.Seek()

"renojim" wrote:
I've had the same results as you. I even created an mp3 of me counting 1 number per second and the time it seeks seems to be totally random.


Thanks. At least now I know I wasn't losing my mind. :shock:
twitter:nowhereman
http://www.thenowhereman.com/roku
http://www.thenowhereman.com/netflix
0 Kudos
RokuMarkn
Visitor

Re: roAudioPlayer.Seek()

It's been a while since I looked at this, but I believe MP3 files don't contain indexing information that would tell the player where to seek. For CBR MP3s it would be possible to make a pretty good guess based on the stream bandwidth (although the player doesn't currently do this) but for VBR it would be essentially impossible to seek accurately.

--Mark
0 Kudos
renojim
Community Streaming Expert

Re: roAudioPlayer.Seek()

I did a little research myself and it looks like some (all?) mp3 software players, and possibly hardware players, seek by brute force working their way through the mp3 data packets. Is that something that's possible with the Roku hardware/software or would it take too long to be usable?

-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
destruk
Streaming Star

Re: roAudioPlayer.Seek()

I really wish this feature would work. I mean, if you have a 3 hour long podcast episode in mp3 format, with a working seek feature you could listen to an hour, store a bookmark, and resume it later instead of having to start all over from minute 0 again. Not to mention being able to use fast forward or a button press to jump ahead past topics being discussed you don't want to listen to. I was thinking of splitting the podcast into 12 mp3 files - that would make each one 15 minutes long, and setting it to a playlist, so pressing the right arrow key could skip ahead 15 minutes, and left arrow could go back 15 minutes, but each time it does that there is a rebuffering delay, and it's not an exact 15 minutes unless you want to cut into the middle of a word. It's much more difficult that way - not optimal either. Does Seek work for WMA?
Would the issue probably be in the documentation already?
Boolean Seek(Integer OffsetMs)
Set the start point of playback for the current song to OffsetMs milliseconds.

How can a boolean pass an integer? Or am I reading that as a boolean return value?

If I can make a suggestion, why not use mp3's seek feature to be a byte offset for the file itself? That way the developer would at least have some way of fast forward through the file? That wouldn't require any knowledge of the file contents besides the total filesize. start is 0, end is number of bytes for the file length, and split it into a number of arbitrary pieces like jump ahead 100,000 bytes or something.
0 Kudos
TheEndless
Channel Surfer

Re: roAudioPlayer.Seek()

"destruk" wrote:
Boolean Seek(Integer OffsetMs)
Set the start point of playback for the current song to OffsetMs milliseconds.

How can a boolean pass an integer? Or am I reading that as a boolean return value?

Boolean is the return value.
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: roAudioPlayer.Seek()

ok, any thought to the other ideas? 🙂
0 Kudos
jbrave
Channel Surfer

Re: roAudioPlayer.Seek()

Hi RokuMarkN, this might help with writing more (but not perfectly) accurate mp3 seeking code:

http://www.getid3.org/phpBB3/viewtopic.php?f=3&t=439

and this 12 page document might also be useful:

"Inside the mp3 codec"
http://www.mp3-converter.com/mp3codec/
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
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.