On Saturday 16 January 2010, at 21.47.09, Nils Hammerfest <list(a)nilsgey.de>
wrote:
Hi,
I search for a free and open source sound/music lib to integrate sound and
music in a game. The game runs on Lin/Win32/OSX so it has to be
crossplatform.
What sort of sound and music formats do you have in mind? mp3, ogg or similar?
"Structured music" (MIDI, MODs etc) or streaming?
I know openAL, but this is too big and tons of people
have problems with
it.
I don't know about Win32 and OS X, but my 64-bit Linux libopenal.so.1.9.563 is
just under 180 kB, which doesn't seem all that much for any non-trivial
library...
Anything slimmer around?
What kind of size do you have in mind (ballpark), and what should it do, more
specifically?
For comparison, my Audiality sound/music engine (used in Kobo Deluxe) compiles
to 205 kB (0.1.2 maintenance branch; 64 bit x86), and provides roughly the
following functionality, as configured and built here:
* MIDI file loading and playback
* "Live" MIDI input
* Support for ALSA and SDL audio I/O, and output to file
* Off-line modular synthesis, which is driven by a...
* ...simple scripting/data language (ancient predecessor to EEL)
* Realtime synth with resampling (pitch), looping and envelopes
* Mono/poly note/voice management with sustain pedal logic
* Mixer with arbitrary routing (send from anywhere to anywhere)
* Realtime reverb, chorus, delay, auto-wah and limiter
It's not the most well designed piece of code out there (which is the main
reason I'm rewriting it from scratch), so one could certainly squeeze some
more features in that code size, or shrink the code a bit.
If you want support for various audio file formats - especially compressed
ones, such as FLAC, mp3, Ogg etc - code size is going to increase a bit,
except maybe if you dare rely on CODECs built into the OS where possible.
OTOH, you probably won't have much use for a modular synthesizer, so that
remove that and add a suitable audio decoder, and you might end up with about
the same size.
Either way, as long as you're going to use raw or encoded samples (as opposed
to structured audio), why worry so much about engine code size...? It'd have
to be a pretty bloated engine to get a code size anywhere near the size of the
data to be played!
Turning it around, using structured audio pretty much eliminates data size
from the equation (all sounds of Kobo Deluxe, including two MIDI songs,
compress to 15 kB), so it might not be the end of the world if the engine is a
bit larger than a trivial WAV player... The downside of this is that you can't
just grab (or record) some samples and use them in your game. Sound effects
and instruments must be created in about the same way as you would for
machines using YM, OPL, SID and similar chips; no sample playback - "pure"
synthesis only. However, the virtual "chips" are much more powerful, so it
doesn't really have to sound synthesized, unless explicitly intended to.
Anyway, although Audiality isn't exactly an optimal example, I think it should
give you some idea of what you can expect in terms of features vs code size.
I'd personally consider anything that does less and/or is larger to be very
bloated, but standards differ...! ;-)
For some perspective, people are coding intros and demos in 64 kB and less,
TOTAL, with music, graphics and everything. And no, they don't sound, nor look
like something running on an old 8 bit computer. Pretty impressive stuff,
worth checking out.
The bottom line is that there is really no lower (or upper) limit to code or
data size here, and no distinct relation between size and quality. It
basically comes down to creativity and resources.
--
//David Olofson - Developer, Artist, Open Source Advocate
.--- Games, examples, libraries, scripting, sound, music, graphics ---.
|
http://olofson.net http://kobodeluxe.com http://audiality.org |
|
http://eel.olofson.net http://zeespace.net http://reologica.se |
'---------------------------------------------------------------------'