Simple C library

I am looking for a simple-ish library for audio output. I would like it to meet these criteria:

  • License for LPGL / zlib / MIT or something similar - I am going to use it in a separate commercial application, and I do not have money for a license.
  • Written in C, but C ++ is fine.
  • Cross-platform (Windows, Linux, possibly OSX)
  • The ability to read from some kind of audio file (I would prefer WAV or OGG, but I will be happy to use less popular formats, if necessary) in memory (I saw the use of memfile structure and user I / O). I need the file to be in memory, because I put all my resources in a .zip archive, and I use another library to load these archive files into Memory.
  • Supports simultaneous playback of multiple sounds, maximum 8 or so.
  • I would really like to have a source code or a static library (MinGW / GCC lib???.a), but if nothing is available, I will use a shared library.

In my search, I must have collected two dozen different audio libraries, all of which did not quite meet these criteria ...

+5
source share
4 answers

I would recommend PortAudio + libsndfile. A very popular combo that meets your requirements. Used by many other software applications, including audacity.

+2
source

Some of the candidates that immediately spring, in my opinion:

, . , ? .

+1

, SDL SDL_mixer. . SDL_mixer, .

+1

In the end, I used PortAudio (a very low-level flexible license) and wrote the mixer myself. See this section, which I did in the C ++ forums , for some other people who wrote about creating a custom mixer. It’s not at all difficult, really; I am surprised that there are so many mixing libraries. For a breakdown of the WAV format (stream-ready source audio data with a 44-byte header) see this .

+1
source

All Articles