The code is something like this:
#include <iostream>
using namespace std;
#include <SFML/Audio.hpp>
void debug(string msg) {
cout << msg << "\n";
};
int main() {
sf::SoundBuffer buffer = sf::SoundBuffer();
if (!buffer.LoadFromFile("sound.wav")) {
debug("error in SFML-AUDIO::cpp::loadFromFile");
};
sf::Sound sound = sf::Sound();
sound.SetBuffer(buffer);
for (int i = 0; i < 10; i++) {
sound.Play();
debug("Play() called");
Sleep(2000);
};
};
(note: Sleep() is from the Win32 api, not sf::Sleep() from sfml.)
Of course, it's not that exact to just look at the console and try to see (and hear) a delay between the console output and the sound, but it's definitely a much smaller delay on Linux.
Additionally I wrote a testing program that triggers a sound for every keystroke. It uses Qt and is written in Haskell (calling sfml-audio functions via minimal bindings), so I won't post it here (unless someone wants me to). With this interactive program it's easy to verify, that sound playback is not as snappy as it should be.
Do you use the openal32 DLL provided in the SFML SDK?
I hope so. I put the open32.dll-file that comes with sfml into the same folder as the executable. (And I get an error if I don't. But there is another openal32.dll on my system and I am always confused where windows looks for dlls.)
Thanks for your quick help.