I've got two tracks playing (tried both .wav and .ogg, same thing)
I set both to loop endless, so:
1) First time plays smoothly
2) Transits to the 2nd time seamlessly
3) But crashes at the 3rd time.
Crash can be described as repetitive 0.5sec of a portion of the sound clip. So if song is "You are my sunshine", the program just repeats "You are... You are... You are... You are... ... ..." (Hope this explains clearly)
Info about audio clips:
Both clips have length of 8 seconds.
.wav and .ogg same problem.
if it helps, it's the usual 16bit 44100hz.
#include <SFML/Audio.hpp>
#include <iostream>
using namespace std;
int main()
{
cout << "Welcome" << endl;
//Load music
sf::Music musik;
if (!musik.OpenFromFile("rockdrums.ogg"))
return EXIT_FAILURE;
sf::Music musik2;
if (!musik2.OpenFromFile("rocksynth.ogg"))
return EXIT_FAILURE;
musik.SetLoop(true);
musik2.SetLoop(true);
musik.Play();
musik2.Play();
cout << "Playing...";
while(1) { };
cout << "End..." << endl;
return EXIT_SUCCESS;
}
[/code]