Matthieu Regnauld
2018-Nov-03 21:18 UTC
[Vorbis-dev] Decode ogg file while downloading: what are the good practices?
Well, your " OggPlayer::release; OggPlayer::open; before OggPlayer::seek" seems to work! Thank you so much! Also, I'll take a look at the Opus codec, thanks for the advice! For your information, here was the problem in details: let's say I download an audio file whose length is 300 seconds. When, for example, 15 seconds of the file were downloaded, I called OggPlayer::open(). After that moment, even if the file was fully downloaded, I was able to seek in the file, but only between 0 and 15 seconds (whether I use ov_pcm_seek() or even ov_raw_seek()). So yes, that makes sence if libvorbisfile builds a seek table only when opening the file. That said, isn't there any function that allows to rebuild that seek table? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/vorbis-dev/attachments/20181103/23d1763e/attachment.html>
Ralph Giles
2018-Nov-03 21:52 UTC
[Vorbis-dev] Decode ogg file while downloading: what are the good practices?
On 2018-11-03 02:18 PM, Matthieu Regnauld wrote: .> When, for example, 15 seconds of the file were downloaded, I called > OggPlayer::open(). > After that moment, even if the file was fully downloaded, I was able to > seek in the file, but only between 0 and 15 seconds (whether I > useov_pcm_seek() or even ov_raw_seek()).That all seems consistent. Glad the work-around was helpful.> That said, isn't there any function that allows to rebuild that seek table?Nope. I don't recall anyone with this particular usecase in the past. Players have tended to assume the resource is non-seekable, or implemented seek over http. Doesn't look like it would be too hard to add an ov_reopen() or similar, if you're interested in contributing something. I think it would still have to be an explicit call before the seek, since it's considerably more expensive than a normal seek. Is the overhead of closing and re-opening the handle significant on android? -r
Matthieu Regnauld
2018-Nov-05 08:55 UTC
[Vorbis-dev] Decode ogg file while downloading: what are the good practices?
OK, thanks for the information.> Is the overhead of closing and re-opening the handle significant onandroid? Not that much: I can close, reopen and seek in a file right before extracting samples to play a second audio file, while a first file is already extracting and playing, without any glitch, even on low-end device. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/vorbis-dev/attachments/20181105/0896af60/attachment.html>
Apparently Analagous Threads
- Decode ogg file while downloading: what are the good practices?
- Decode ogg file while downloading: what are the good practices?
- Decode ogg file while downloading: what are the good practices?
- Decode ogg file while downloading: what are the good practices?
- Decode ogg file while downloading: what are the good practices?