I am trying to play an .ogg file in SFML, I have all the DLLs and the libraries etc, but for some reason nothing plays when I start the code. I have read the tutorials and have looked around a bit to see if I could fix it myself, but had no avail. I think it might have something to do with the buffer in the wrong place, but not sure. Furthermore the window freezes when opened, don't know what is wrong. Any ideas?
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");
sf::SoundBuffer buffer;
buffer.loadFromFile("mine.ogg");
sf::Sound sound;
sound.setBuffer(buffer);
while (window.isOpen())
{
sound.play();
}
}