1
Audio / Program loads .WAV but does not play it back an/or I cant hear it!
« on: December 16, 2015, 10:08:50 pm »
I'm creating a small game and I wanted my program to play music in the main meny this is how it looks like now:
I know that it is not the best but I wanted to test it out I have also done exactly like the tutorial said about playing music but it did not work either.
What is wrong with this?
I'm also using DirectX to draw it all and using SFML to do some back end stuff as networking and sound!
Thanks!
void MainMenyMusic::PlayMusic()
{
sf::Music music;
music.setVolume(50);
if (music.openFromFile("test.wav") && !music.Playing)
{
music.play();
}
if (!music.openFromFile("test.wav"))
{
exit(0);
}
}
{
sf::Music music;
music.setVolume(50);
if (music.openFromFile("test.wav") && !music.Playing)
{
music.play();
}
if (!music.openFromFile("test.wav"))
{
exit(0);
}
}
I know that it is not the best but I wanted to test it out I have also done exactly like the tutorial said about playing music but it did not work either.
What is wrong with this?
I'm also using DirectX to draw it all and using SFML to do some back end stuff as networking and sound!
Thanks!