SFML community forums
Help => Audio => Topic started by: mentaman10 on March 21, 2012, 07:01:33 pm
-
Hello, I have sfml 2.
I can load only wav, I can't load ogg, why is it?
wav's size is 19MB, ogg's size is 0.5MB...
if(!sound.OpenFromFile("data/back.wav"))
messages.push_back("can't load the music");
-
The same as you, but i can read only ONE ogg I converted from mp3 to ogg. I've converted a lot of file from wma to ogg the same way and SFML can't read it !
Edit: it work again when I convert ogg files to wav files, so I think my converter is't in cause. Maybe the sampling frequency or bitrate but I never modified them so I don't see why sometimes it works and smetimes not :-\
-
First, make sure that you're using a version of libsndfile which is recent enough (on Windows, you should use the DLL provided by SFML).
Then, what error message do you get when it fails?
-
I don't have any message in the console, that's weird. But the loadFromFile() method returns false.