Hi,
So I'm basically creating a thread for music with the code;
void startMusic() {
sf::Music music;
music.openFromFile("upandaway.ogg");
music.setLoop(true);
music.play();
while (music.getStatus() == sf::Music::Status::Playing) {}
}
sf::Thread thread(&startMusic)
Obviously a while loop is not a viable way due to very high memory usage (tried it, and it was using 50% of my CPU. 50% for music!)
What would be an alternative to this, to keep the music running while keeping CPU Usage relatively low?