Let's say I have two SoundBuffer objects Buffer1 and Buffer2.
I have a Sound object, which is currently playing from Buffer 1 with looping on.
At certain times, the Sound object must switch between playing from Buffer 1 and playing from Buffer 2.
But when switching buffers, the sound gets briefly interrupted.
Imagine both buffers simply contain a sine wave: I want to switch buffers, but still hears a continuous, uninterrupted sine wave, as it would have been if I did not switch buffers.
My code goes something like this:
sf::Time offset = sound.getPlayingOffset();
sound.setBuffer(Buffer2);
sound.setPlayingOffset(offset);
So, how can I achieve uninterrupted sound when switching buffers? Thanks!!