SetLoop(true) does not give seamless looping
And you think it's SFML's fault? As far as I know, looping sounds loop perfectly (there's no lag between the end and the beginning). Couldn't it be something on your side? Does it work with a loaded sound rather than a recorded one?
A loaded sound?!
Sorry, what loaded sound?
Records the sound with SoundBufferRecorder, .GetBuffer() stores it in a SoundBuffer (SFML's own), passes that to Sound (SFML's own), sets the Sound with .SetLoop(true), then .Play(). Sound loops, there's a gap. Why would it be anything on 'my side'? You make it sound like I'm trying to intentionally slur you or something.
sf::SoundBufferRecorder Test;
Test.Start();
system("PAUSE");
Test.Stop();
sf::SoundBuffer Test2;
Test2 = Test.GetBuffer();
sf::Sound Test3;
Test3.SetBuffer(Test2);
Test3.SetLoop(true);
Test3.Play();
system("PAUSE");
return 0;
Replace system("PAUSE"); with whatever pause preference you have. There's a gap in the loop. Try humming a constant note and you'll notice it.
Thanks, I'll test it myself and see if this silence can be avoided.
You can easily remove audio samples:
sf::SoundBuffer buffer; // loaded with your recorded sound
int begin = buffer.getSampleRate() * buffer.getChannelCount() * 0.5f; // 0.5 seconds
sf::SoundBuffer withoutSilence;
withoutSilence.loadFromSamples(buffer.getSamples() + begin, buffer.getSampleCount() - begin, buffer.getSampleRate(), buffer.getChannelCount());