RadioDroid
RadioDroid copied to clipboard
[WIP] Pre-Recording: Record and keep always the last ~30 seconds in RAM buffer
Resolves #437
Seems to work, but needs more testing and some configuration option.
Some thoughts:
- Yes, option is a must. Also the length of buffer itself should also be an option, it doesn't take a lot of ram and copying memory is cheap.
- In many cases we know when song starts/ends so we can reset the buffer when a new song starts.
- Do not write to buffer when we are already recording.
f2212c4 - probably does not belong here 36ecd91 - seems good 9afbe15 - could you elaborate what does this change?
@morckx what's state of this PR? It's really useful feature
@morckx what's state of this PR? It's really useful feature
I think so too, particularly, since recording currently starts with a delay of ExoPlayer's buffer size (~5s).
The only issue that was left in the discussion was to calculate the buffer size in seconds depending on individual streams' bitrates. Personally, I don't think that this is worth the effort as it will be an estimation only anyway and performance-wise it would make more sense to just have a fixed buffer size in bytes. I think I'll just keep it with bytes now and adapt it to the new settings.
When #495 is merged, we can maybe use the bitrate estimation from there to make the buffer size adjustable in secondes rather than kB – in a subsequent PR.
in WIP too long, closing please create another PR if you want to work on it.