SFML community forums
Help => Audio => Topic started by: CytraL on May 10, 2013, 06:25:48 pm
-
Hi! I've never had problems playing sounds but with 2.0 yes.. xDD
sf::Music musicIntro;
if (musicIntro.openFromFile("sonidos/intro.ogg"))
{
//musicIntro.setPitch(1.0f);
//musicIntro.setVolume(100);
musicIntro.play();
}
I try with .wav and .ogg... Can found the sound here: http://soundbible.com/1563-Pacman-Introduction-Music.html (http://soundbible.com/1563-Pacman-Introduction-Music.html)
P.S: SFML not show errors in console..
P.S 2: Sry for my bad english :d
-------------------
Yes... i know.... omg.... xDD
-
You re doing that code in a local scope, like a function or something. When that function ends, the sf::Music object is destroyed and you don't get to hear anything.
Define sf::Music in a place that it will remain alive for longer time
-
Fuuuuuuu.... sry sry sry sry sry sry sry sry sry xDDDDD