Thank you! This is what I've been looking for.. now I just need to find out why onGetData isn't called after I return 0 samples twice in a row, but that's probably some problem on my side
I have a sample rate of 22050, I return about 23000 samples on the first call. that should be enough for 1 second. SFML calls onGetData again twice immediatly (where I return 0 samples both times, but a return value of true, to indicate there is more data coming). Then SFML never again calls onGetData, even though I have new data available every 1/15s, which would be plenty... I can't find a bug in my program, and I can't see anything strange in SoundStream.cpp, any ideas?
EDIT:
The problem seems to be that SFML internally uses 3 sound buffers. If I don't return all available data on the first call, but keep some for later, things work.
Is this considered a bug? Otherwise, some mention of this in the documentation might be helpful
Thanks to zagabar for pointing me in that direction!