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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - cptn ndongo

Pages: [1]
1
SFML wiki / Code sample on how to add Mp3 support using mpg123
« on: August 25, 2015, 04:23:11 pm »
Hello!

I wrote a small program which reads from Mp3 files and plays them. View it on github here: https://github.com/hansiC/sfml-soundfileReader-example

I based it mostly on an example I found in the wiki or on the sfml homepage some time ago. The original example directly subclassed sf::Music and implemented the mp3 support in that class. The downside to this approach is that you lose support for the natively supported formats,  wav, ogg and flac.

The prefered way is to subclass sf::SoundFileReader and register it using the static template function sf::SoundFileFactory::registerReader().

So this is what my code example demonstrates. I thought it might be a good addition to the wiki or the code examples on the homepage. Feel free to use any code from my repository.

Pages: [1]
anything