SFML community forums

Help => Audio => Topic started by: mentaman10 on March 21, 2012, 07:01:33 pm

Title: ogg sfml 2
Post 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...

Code: [Select]
if(!sound.OpenFromFile("data/back.wav"))
messages.push_back("can't load the music");
Title: Re: ogg sfml 2
Post by: Lo-X on April 12, 2012, 03:17:43 am
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  :-\
Title: Re: ogg sfml 2
Post by: Laurent on April 12, 2012, 08:06:30 am
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?
Title: Re: ogg sfml 2
Post by: Lo-X on April 12, 2012, 10:32:38 pm
I don't have any message in the console, that's weird. But the loadFromFile() method returns false.