SFML community forums
Help => Audio => Topic started by: unbel on June 19, 2009, 07:51:07 pm
-
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();
}
-
Make sure that your sound is mono, not stereo.
-
Make sure that your sound is mono, not stereo.
Oops.. Now it's ok.
Sorry :)