Expand description
Streaming HTTP → growing-buffer reader for the audio pipeline.
open_stream starts a background thread that downloads url via
reqwest::blocking, appending chunks to a shared Vec<u8>. The
StreamingReader returned immediately exposes that buffer as a Read + Seek handle that blocks only when the read position overtakes the download.
Keeping all bytes (never freeing) means backward seeks always succeed without re-fetching. Trade-off: memory grows with the file (~14–30 MB for a typical song), which is acceptable for a music player.
Playback starts as soon as 256 KB have been buffered (PREBUFFER_BYTES).
Structs§
- Streaming
Reader - A
Read + Seekhandle to a streaming HTTP response.
Functions§
- open_
stream - Start streaming
urlin a background thread and return a reader that blocks only when the read position overtakes the download.