Description
My use case is audio book files which could span more than a few gigabytes data of MP3.
Using normal buffer will not work because you cant load 2GB MP3 on a low-end phone into RAM (and that's not even decoded samples, which requires way more memory), so I think releasing buffer is a great choice here, but you can't seek such a buffer.
Currently streaming in implemented in a push way: user pushes data as soon as it is available for engine to use.
I think that adding API for pull style buffering will solve this issue: audio engine can ask for data it's missing.
For example supplying data on demand using HTTP Range requests or reading from NAS.
There is also a case of using decryption on-the-fly, so this feature not limited to HTTP.
Requirements
Additional Context
There is need for an additional logic during initial playback in case user ask to seek from the start, since you must first request file header with metadata and then you can seek to desired position. (Iff we're not supplying raw PCM)
I'm planning to cache played parts of file, but not download entire 2GB over a mobile network. For example first megabyte with metadata and then wherever user seeks to.
Description
My use case is audio book files which could span more than a few gigabytes data of MP3.
Using normal buffer will not work because you cant load 2GB MP3 on a low-end phone into RAM (and that's not even decoded samples, which requires way more memory), so I think releasing buffer is a great choice here, but you can't seek such a buffer.
Currently streaming in implemented in a push way: user pushes data as soon as it is available for engine to use.
I think that adding API for pull style buffering will solve this issue: audio engine can ask for data it's missing.
For example supplying data on demand using HTTP Range requests or reading from NAS.
There is also a case of using decryption on-the-fly, so this feature not limited to HTTP.
Requirements
Additional Context
There is need for an additional logic during initial playback in case user ask to seek from the start, since you must first request file header with metadata and then you can seek to desired position. (Iff we're not supplying raw PCM)
I'm planning to cache played parts of file, but not download entire 2GB over a mobile network. For example first megabyte with metadata and then wherever user seeks to.