dimitris-c / AudioStreaming

An AudioPlayer/Streaming library for iOS written in Swift using AVAudioEngine.
MIT License
266 stars 56 forks source link

Seeking within existing buffers #95

Closed jacksonh closed 1 month ago

jacksonh commented 2 months ago

Is there a way I could seek if its within the current buffered data? For instance imagine progress is at 10s, duration is 20s. Could seeking forward 5s or backwards 5s work without seek being called on my underlying stream?

dimitris-c commented 1 month ago

Unfortunately I don't think that's possible with the current implementation. To achieve this I believe audio buffer should be cached and revisit on seek. In theory it's possible but I believe in practice it will be quite some work to do.

jacksonh commented 1 month ago

Thank you, yeah I guess I just need to implement proper caching then this issue goes away. Probably more a responsibility of the stream provider than the underlying system.