Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sounds not work in 3d  (Read 3849 times)

0 Members and 1 Guest are viewing this topic.

unbel

  • Newbie
  • *
  • Posts: 8
    • View Profile
sounds not work in 3d
« 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();
     }


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sounds not work in 3d
« Reply #1 on: June 19, 2009, 11:32:09 pm »
Make sure that your sound is mono, not stereo.
Laurent Gomila - SFML developer

unbel

  • Newbie
  • *
  • Posts: 8
    • View Profile
sounds not work in 3d
« Reply #2 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 :)