Sign in to follow this  
Followers 0
ic0de

Can anyone recommend an audio decoding library?

7 posts in this topic

I'm looking for a cross platform library for decoding audio. Up until recently my game used SDL_Mixer for both decoding and playback but then I switched to OpenAL for playback and kept decoding with SDL_Mixer. SDL_Mixer has a few problems that make it non ideal for my project, it doesn't support many formats and it's strengths seem to be more with playback. What I need is a simple library that can load audio file and place them in a buffer for OpenAL to access. Does anyone have any experience with good libraries that they would recommend? I need support for at least the following formats:

 

FLAC

OGG

MIDI

WAV

 

Thanks.

 

EDIT: Forgot to mention I was using C++, C libraries are acceptable too though

Edited by ic0de
0

Share this post


Link to post
Share on other sites

It seems like BASS may do what you want.

http://www.un4seen.com/bass.html

 

Decode without playback

Streams and MOD musics can be outputted in any way you want (encoded, written to disk, streamed across a network, etc...)

 

Yeah BASS seems pretty cool and it seems to do what I need but the license could get a little restrictive in case I wanted to sell.

 

BASS is free for non-commercial use. If you are a non-commercial entity (eg. an individual) and you are not making any money from your product (through sales, advertising, etc), then you can use BASS in it for free. Otherwise, one of the following licences will be required.

0

Share this post


Link to post
Share on other sites

To be honest, you're going to have a hard time finding a library that can do all of those (with a permissive license). The biggest problem will be MIDI. Most of the audio decoding libraries I know of don't support MIDI, and the ones I know of that do are commercial. If you're okay with the LGPL, there are FFmpeg and sndfile that can be used to decode FLAC, OGG (Vorbis), and WAV. As for MIDI support, you may have to use another library that only supports MIDI, and then write a common wrapper around your two audio decoding libraries (which will choose the right decoder for the specified format).

0

Share this post


Link to post
Share on other sites

To be honest, you're going to have a hard time finding a library that can do all of those (with a permissive license). The biggest problem will be MIDI. Most of the audio decoding libraries I know of don't support MIDI, and the ones I know of that do are commercial. If you're okay with the LGPL, there are FFmpeg and sndfile that can be used to decode FLAC, OGG (Vorbis), and WAV. As for MIDI support, you may have to use another library that only supports MIDI, and then write a common wrapper around your two audio decoding libraries (which will choose the right decoder for the specified format).

 

Yeah I suppose I could live without MIDI

0

Share this post


Link to post
Share on other sites

If you really like to load only sound files, either use wave for simple/short ones and this ogg-vobis loader (public domain, single header file !) for music streaming and larger files. You can convert audio files with audacity (open source tool).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0