Skip to main content
GameDev.net gamedev.net
🔒 Locked

Can anyone recommend an audio decoding library?

Started by Jake S. C++ Jun 8, 2013 at 10:26 PM 6 replies 2.2k views
Original Post
Jake S. C++
Jake S. C++

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

GameCreator
GameCreator

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

Jake S. C++
Jake S. C++


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.

Cornstalks
Cornstalks

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

Jake S. C++
Jake S. C++

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.