• Advertisement
Sign in to follow this  

Can anyone recommend an audio decoding library?

This topic is 1642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

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).

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

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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement