Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: ogg sfml 2  (Read 2785 times)

0 Members and 1 Guest are viewing this topic.

mentaman10

  • Newbie
  • *
  • Posts: 16
    • View Profile
ogg sfml 2
« 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");

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: ogg sfml 2
« Reply #1 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  :-\
« Last Edit: April 12, 2012, 03:27:51 am by Lo-X »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: ogg sfml 2
« Reply #2 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?
Laurent Gomila - SFML developer

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: ogg sfml 2
« Reply #3 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.