Hello,
I am trying to create an audio on the fly. I want a sound to be playing and while that happens new audio samples should be pulled from a function.
I have looked at the sf::SoundStream class. But this requires you to push back a few thousand new samples each time onGetData(Chunk& data) gets called. I want to provide only 1 sample. The function onGetData should look something like this:
sf::Int16 pullSample()
{
return 1000 * std::sin(currentTime * ...);
}
I know that this requires with a sample rate of 44100, 44100 calls to that function each second. Is this still somehow possible or are there other work-arounds?