Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Can anyone recommend an audio decoding library?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 ic0de   Members   -  Reputation: 895

Like
0Likes
Like

Posted 08 June 2013 - 04:26 PM

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, 08 June 2013 - 05:42 PM.

you know you program too much when you start ending sentences with semicolons;


Sponsor:

#2 GameCreator   Members   -  Reputation: 772

Like
0Likes
Like

Posted 08 June 2013 - 05:33 PM

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

 



#3 ic0de   Members   -  Reputation: 895

Like
0Likes
Like

Posted 08 June 2013 - 05:40 PM

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.


you know you program too much when you start ending sentences with semicolons;


#4 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 08 June 2013 - 06:05 PM

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


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#5 ic0de   Members   -  Reputation: 895

Like
0Likes
Like

Posted 09 June 2013 - 08:11 AM

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


you know you program too much when you start ending sentences with semicolons;


#6 Ashaman73   Crossbones+   -  Reputation: 7872

Like
0Likes
Like

Posted 10 June 2013 - 02:39 AM

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



#7 Kryzon   Prime Members   -  Reputation: 3248

Like
0Likes
Like

Posted 13 June 2013 - 03:54 PM

Check SFML: http://stackoverflow.com/questions/3636715/cross-platform-sound-api-for-games

 

https://github.com/LaurentGomila/SFML/wiki/FAQ#wiki-audio-formats

 

EDIT: IrrKLang is commercial, but doesn't cost that much and supports MOD and XM, to which MIDI can be easily converted.


Edited by Kryzon, 13 June 2013 - 04:08 PM.


#8 MarekKnows.com   Members   -  Reputation: 686

Like
0Likes
Like

Posted 22 July 2013 - 01:41 PM

I use Vorbis for sounds: http://www.vorbis.com/


---
Free C++, OpenGL, and Game Development Video Tutorials @
www.MarekKnows.com
Play my free games: Ghost Toast, Zing, Jewel Thief





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS