4 ms·
Instead of struggling to generate this in real time, perhaps you could generate it in advance and loop it? The median Taylor Swift song is 3:52, then at 20M sa
by jefftk 2y ago
Instead of struggling to generate this in real time, perhaps you could generate it in advance and loop it? The median Taylor Swift song is 3:52, then at 20M samples per second (and four bytes per sample) you need a little over 19GB [1] and I think streaming from SSD should be fast enough. Could probably also compress it.
[1] 20e6*(60*3+52)*4 / 1e9
- eieio 2y agoI'm not sure if Stephen is on HN, but I asked him this question last week[1]. His response was that since the songs are different lengths, a file that was truly loop-able would be super long (if you have a 90 second song and a 2 minute song, you need 6 minutes of audio to create a file that perfectly loops both of them) Seems like there is probably some set of clever hacks here that could get you around this (although I don't know enough about radio to propose any); I think I asked about pre-computing some state for each song on its own and he had a good response to why that either didn't work or didn't help much, but unfortunately I don't remember it! [1] we are both currently at the Recurse Center / https://recurse.com https://recurse.com
- jefftk 2y agoI was thinking you could pick a group of songs that were close to the same length, and then make up the difference with fading, gaps, or a fake DJ? For this to work I think you want your overall loop to be just a few minutes.