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.


Audio library pros/cons


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
11 replies to this topic

#1 Nairou   Members   -  Reputation: 429

Like
1Likes
Like

Posted 27 July 2012 - 03:29 PM

I'm ready to start adding sound effects to my game, so I've been looking at audio libraries. My requirements are that the library be cross-platform, free for commercial use, and under a friendly license (not GPL/LGPL).

The three main options I see right now are Fmod, OpenAL, and PortAudio. However, each one has both pros and cons to them.

Everyone knows Fmod, its used in tons of game, has all sorts of tools to make it easy. There is a free version of it, but I eventually plan to sell my game, so I can't go with a free license. However, I also can't afford to spend $500 on an audio library.

OpenAL seemed to be the next logical choice. Not so simple, not as much documentation, but free to use. However, in looking into it again recently, it appears that development has gone proprietary, and only the old 1.1 version is still freely available. Choosing an old abandoned library to learn to use for the first time doesn't sound like all that great an idea.

And then there is PortAudio. Also free, and very much in active development. However, it is also extremely low level, more targeted towards professional audio applications than games. It seems to be little more than an abstraction of the audio hardware, so everything on top of that (file decoding, volume adjustment, effects, etc.) I would have to do myself (or find another library to sit on top of it). On one hand, it could be really useful when it comes to generating abstract sounds rather than just playing pre-recorded files (something I plan to do eventually to some degree), but for everything else it sounds like it will be a huge undertaking.

None of them seem to be ideal, but I haven't had much luck finding another audio library that fits my requirements. Are there other options that people know of? Something I'm overlooking?

Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 27 July 2012 - 03:32 PM

Out of curiosity, why do you consider the LGPL to not be friendly?
[ 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 ]

#3 Nairou   Members   -  Reputation: 429

Like
1Likes
Like

Posted 27 July 2012 - 03:42 PM

Admittedly not for very strong reasons. Mostly because it prevents me from static linking the library. I don't know if there are other restrictions, the LGPL license is rather cryptic.

#4 Acharis   Crossbones+   -  Reputation: 3897

Like
0Likes
Like

Posted 27 July 2012 - 11:25 PM

Why not SDL_mixer? If you want cross platform you would probably want to use the basic SDL anyway, so adding to it the mixer library seems like the most convenient choice.

I have heard some rumours that there are problems with OpenAL on Linux, but I can't confirm the credibility of this rumour.

Europe1300.eu - Historical Realistic Medieval Sim (RELEASED!)


#5 Nairou   Members   -  Reputation: 429

Like
0Likes
Like

Posted 28 July 2012 - 12:03 AM

I assume SDL_mixer can't be used independently from the rest of SDL? I'm using GLFW for display and input, I never cared much for SDL.

#6 Acharis   Crossbones+   -  Reputation: 3897

Like
0Likes
Like

Posted 28 July 2012 - 12:42 AM

I assume SDL_mixer can't be used independently from the rest of SDL? I'm using GLFW for display and input, I never cared much for SDL.

Well, you could install SDL + SDL_mixer and then only initialize the AUDIO component and ignore the rest... But that would not make much practical sense I guess.

Europe1300.eu - Historical Realistic Medieval Sim (RELEASED!)


#7 rakifsul   Members   -  Reputation: 100

Like
-2Likes
Like

Posted 10 November 2012 - 06:29 PM

You should try MMAV (see http://chucklesoft.blogspot.com).

#8 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 05 December 2012 - 12:11 PM

Sorry about the thread-gravedigging.

I don't really know much about sound libraries, but came across this as I'm looking for something similar.
I stumbled upon a thread on StackOverflow pointing me to SFML.
That seems to be popular, and the license is very open: http://www.sfml-dev.org/license.php


#9 Cornstalks   Crossbones+   -  Reputation: 6991

Like
0Likes
Like

Posted 05 December 2012 - 12:24 PM

Sorry about the thread-gravedigging.

I don't really know much about sound libraries, but came across this as I'm looking for something similar.
I stumbled upon a thread on StackOverflow pointing me to SFML.
That seems to be popular, and the license is very open: http://www.sfml-dev.org/license.php

FYI, SFML itself doesn't handle the audio. It just uses sndfile and OpenAL to read/play audio, so you still have to abide by sndfile's and OpenAL's licenses. Look at the bottom of that page you linked to and notice the external libraries used by SFML and their associated licenses, all of which you have to abide by.
[ 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 ]

#10 Nairou   Members   -  Reputation: 429

Like
0Likes
Like

Posted 05 December 2012 - 01:11 PM

As a follow up, I used PortAudio for a while, and got everything up and running with Ogg playback. It worked well, sounded good, but had non-constant latency that I could never fully get rid of.

In the end, I scrapped it and decided to just use each platform's native audio API (XAudio2 on Windows, PulseAudio on Linux) and decode Ogg myself using stb_vorbis, rather than try to find a single cross-platform library to do it all for me. Latency is gone, and I have the platform code abstracted behind a common interface, so it meets my requirements well enough for now.

#11 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 05 December 2012 - 02:11 PM


Sorry about the thread-gravedigging.

I don't really know much about sound libraries, but came across this as I'm looking for something similar.
I stumbled upon a thread on StackOverflow pointing me to SFML.
That seems to be popular, and the license is very open: http://www.sfml-dev.org/license.php

FYI, SFML itself doesn't handle the audio. It just uses sndfile and OpenAL to read/play audio, so you still have to abide by sndfile's and OpenAL's licenses. Look at the bottom of that page you linked to and notice the external libraries used by SFML and their associated licenses, all of which you have to abide by.


Oh... I didn't notice that. Thanks for the heads-up. I should go with Nairou's approach, then,
although it's tempting to be able to construct sounds on the fly with portaudio...

#12 kburkhart84   Members   -  Reputation: 1713

Like
0Likes
Like

Posted 05 December 2012 - 05:39 PM

There is a library called irrKlang that has been created by Niko who created the Irrlicht 3d engine(at least before it was left to the community). It is a commercial engine, but it is cross-platform, and isn't near the price of FMOD. It depends on how much you intend to sell the game for though. You can also use the free version until you are ready to sell, so that you can do the testing and even development of the game meanwhile.

I used it some, and it worked fine for me on windows. It loads the formats etc... for you, like FMOD does, so you don't have to worry about that, or thread loading the sound buffers, or anything low level like that. It also does 3d sound. Under the hood, it can use a few different options, depending on the OS. I'd say it is worth a try.






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