SFML community forums

Help => Audio => Topic started by: unbel on June 19, 2009, 07:51:07 pm

Title: sounds not work in 3d
Post by: unbel on June 19, 2009, 07:51:07 pm
The sound has always the same volume...

Code: [Select]
    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();
     }

Title: sounds not work in 3d
Post by: Laurent on June 19, 2009, 11:32:09 pm
Make sure that your sound is mono, not stereo.
Title: sounds not work in 3d
Post by: unbel on June 20, 2009, 06:42:31 pm
Quote from: "Laurent"
Make sure that your sound is mono, not stereo.

Oops.. Now it's ok.
Sorry :)