1
Audio / Cant get to play next song after first is finnished
« on: January 28, 2014, 12:00:23 am »
I tried something simple. It should work, but simply it doesnt and i have no idea why.
So after first song is finished it should play 2nd song, but it doesnt, no matter what conditional i use.
Anyone have idea how to implement this?
Thanks in advance
-----------------------------------------------------------------------------------
Also i have popping/cracking sound when i use .ogg files. .wav files works ok.
I have sfml 2.1.
sf::Music musicPlayer;
musicPlayer.openFromFile("song1.wav");
musicPlayer.play();
if ( musicPlayer.getStatus() == sf::Music::Stopped )
// OR if ( musicPlayer.getStatus() != sf::Music::Playing )
{
musicPlayer.openFromFile("song2.wav");
musicPlayer.play();
std::cout << "Playing second song" << std::endl;
}
musicPlayer.openFromFile("song1.wav");
musicPlayer.play();
if ( musicPlayer.getStatus() == sf::Music::Stopped )
// OR if ( musicPlayer.getStatus() != sf::Music::Playing )
{
musicPlayer.openFromFile("song2.wav");
musicPlayer.play();
std::cout << "Playing second song" << std::endl;
}
So after first song is finished it should play 2nd song, but it doesnt, no matter what conditional i use.
Anyone have idea how to implement this?
Thanks in advance
-----------------------------------------------------------------------------------
Also i have popping/cracking sound when i use .ogg files. .wav files works ok.
I have sfml 2.1.