SFML community forums
Help => Audio => Topic started by: fatum on September 16, 2011, 09:32:30 pm
-
I have this bit here:
sf::Music test;
if (!test.OpenFromFile("test.ogg"))
{
std::cout << "Oh No!" << std::endl;
}
elsae
{
test.Play();
}
Which doesn't play the audio! However, if I append this right after "test.Play();"
for (;;);
The Music plays as expected. I've also tried adding test.Play(); in the ::update(); method that's called every frame.
What could the issue be? Thanks for any help!
-
What is there after this code? If the Music instance is local to the function, it's destroyed immediately and thus is stopped. It must be alive as long as you want to play it.