Audio Library Comparison

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Audio Library Comparison

      Hey Guys,

      In the book DirectSound and Miles are used for the audio libraries, as my code is cross platform I can't use DirectSound, and Miles exceeds my budget of 0$ at the moment.

      I have been looking into different libraries, specifically ones that would be free for commercial use eventually. I have come across a couple that meet these criteria.

      -SDL_Mixer: Completely free but not very powerful
      -OpenAL: Seems to be dead, even if it's not the newer OpenAL is now proprietary so only the older version is free
      -PortAudio: Not sure what to make of this, it has poor documentation and all reviews say it is more so meant for Audio Creation Applications

      I am having trouble finding anything that really fits the bill, if this is all I have to use then I may have to settle with OpenAL (Even though there licensing for the new version seems scary), I REALLY wanted to use FMOD as it has great reviews, is cross platform and such, however even the cheapest commercial option is 500$. Even if I make a game and sell it for .99$ I will need to dish out 500 bucks, which would be fine if I had the extra money to dish out.

      Does anyone know of a good solution to my problem?
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • RE: Audio Library Comparison

      Unfortunately no, you're rather stuck. OpenAL is probably your best bet, or just writing your own. :-/

      -Rez
    • For anyone interested, there is also OpenAL-Soft. Apparently this is cross platform and free to use for all uses, at first glance it also appeared dead but then looking at their git repository it was last updated 35 hours ago.

      OpenAL-Soft
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Hey,

      So I actually decided to use FMOD and when the time comes to actually sell a game, I will buy a licence for it. I am finding it very nice to use and have everything set up for loading files into memory and decompressing them using the resource cache, but one thing I am having trouble imagining is the streaming.

      Specifically in the book it mentions that streaming is beyond the scope of the book, but I have a question none the less, would i even use my resource cache as an interface for streaming? As far as I understand it streaming involves creating a buffer of a certain size that loads bits of a file from disk without loading the entire file into memory. The resource cache however loads a file into memory and optionally post-processes it (In the case of sound files it decompresses it), am I correct in thinking that using the resource cache is not the right way to go? If this is true, should I still inform the resource cache that memory is being used for a stream buffer? this way the memory budget isn't being fooled into thinking it is using less memory than it actually is.

      What is the best place for me to start?
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • FMOD is a great tool if you can afford it. It's what most of the companies I've worked for used.

      It really depends on how your resource cache is implemented, but typically a resource cache is optimized to load a bunch of files rather than streaming a large file. You'll probably create a specialization of your resource that just loads the file header and sets it up for streaming.

      You have the concept of streaming correct. You create a circular buffer and then fill up that buffer as you read from the hard drive. When it fills up, you start overwriting the old parts of the buffer. There are usually two pointers, one for the read head and one for the write head. You have to make sure that the two never cross paths or bad things can happen. You also typically have the streaming itself to happen on another thread, so you have to handle data sync issues, race conditions, and all the fun stuff associated with sharing data between threads. This is a hard problem to get right, although I seem to remember FMOD having some kind of streaming support.

      -Rez
    • They do have streaming support built in, I mainly wanted to know how I could implement it into a resource cache.

      So basically what I have been doing is using the resource cache to load data, and also post process it if needed, for instance with image files, the only time I use them is for texturing, so it makes sense that I convert them into an OpenGL texture and store them as 'extra data'. I also just finished doing this for FMOD sounds, however, I guess what I am struggling with is, would it be better to directly use the FMOD API for streaming, or should I try my hardest to implement it into my resource cache?
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • If FMOD already has streaming built in then I'd punt and use that just to get things running. Taking on an audio system implementation is pretty tricky stuff, so there's no need to overcomplicate it.

      Once you are comfortable with your implementation, you can take the next step and integrate it with a resource cache.

      Audio systems are by their nature threaded, and any data corruption can result in some nasty hangs or wierd pops and sound glitches that will drive you completely out of your mind.

      My advice, keep things very simple, take everything one step at a time, and for goodness sake use source control or many copies of working code to be able to compare and backtrack if you break something.

      Good luck!
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • I agree with Mike 100%. Make it work, understand how and why it works, then take the time to integrate it into your existing system.

      -Rez
    • Thanks for the advice, I have been trying to wrap my brain around it and that does make sense to just use what they have until I have it figured out better.
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • Here's to bump up an old thread, I found a decent audio library I have been using, and it has relatively cheap licencing options for individual/indie companies.

      irrKlang

      The licensing for an individual for use on commercial products is about 85$

      *Edit*

      Apparently World of Goo used this
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz

      The post was edited 1 time, last by mholley519 ().