Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kevincentius

Pages: [1]
1
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!!

Pages: [1]