The sound has always the same volume...
sf::SoundBuffer Buff;
if (!Buff.LoadFromFile("footsteps.wav"))
return EXIT_FAILURE;
sf::Sound Buffer(Buff, true);
Buffer.SetPosition(3.f, 2.f, 6.f);
Buffer.SetMinDistance(2.f);
Buffer.SetAttenuation(12.f);
Buffer.Play();
while (App.IsOpened()){
sf::Event Event;
while (App.GetEvent(Event)){
if (Event.Type == sf::Event::Closed) App.Close();
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)) App.Close();
}
ax+=0.3;
Buffer.SetPosition(ax, 1, 3);
App.Display();
}