IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Going back to beginning in non-seekable streams?
Rockin' Pete
post Jul 25 2008, 14:08
Post #1





Group: Members
Posts: 7
Joined: 21-June 08
Member No.: 54656



What's the fastest way to go back to the beginning of a non-seekable Ogg/Vorbis stream?

I'd prefer not to have to reopen it because that can easily take 50ms on the slow mobile platform that starts with "i" that I'm working on. It can easily take a second to open an Ogg/Vorbis file as seekable, so we're opening all of our files as non-seekable. But we still need to loop them, and some of them are music files - a bit too big to decompress into memory.
Go to the top of the page
+Quote Post
m00
post Jul 25 2008, 16:04
Post #2





Group: Members
Posts: 30
Joined: 3-March 02
Member No.: 1437



QUOTE (Rockin' Pete @ Jul 25 2008, 13:08) *
What's the fastest way to go back to the beginning of a non-seekable Ogg/Vorbis stream?

I'd prefer not to have to reopen it because that can easily take 50ms on the slow mobile platform that starts with "i" that I'm working on. It can easily take a second to open an Ogg/Vorbis file as seekable, so we're opening all of our files as non-seekable. But we still need to loop them, and some of them are music files - a bit too big to decompress into memory.


Can't you just cache the first few KBs of the stream when you first open it ? Then use that to decode from whilst the file is being re-opened in the background or something ? If you only need to cover 50ms or so then you'll need a tiny amount of memory to cache the start.. Even with a stream at 128Kb/s that's still only 16KB a second so 4K would cover you for easily a quarter of a second.. I don't know how much gumpf sits at the start of Ogg streams, but I can't imagine it's too much..
Go to the top of the page
+Quote Post
Rockin' Pete
post Jul 26 2008, 11:35
Post #3





Group: Members
Posts: 7
Joined: 21-June 08
Member No.: 54656



The problem isn't the I/O. I'm using ov_open_callbacks and memory-mapped files. We have measured our I/O performance and found it to be very efficient - much faster than seeking.

Our product is an audio SDK for video games. We don't have the option of tying up the CPU for that long.

So there's no efficient way to jump back to the beginning of an Ogg/Vorbis file? Or at least, nothing faster than closing it and reopening it?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th August 2014 - 16:32