SDL_Mixer and OpenAL are specialized high level solutions, whereas the
SDL audio API (integrated in SDL) is about as low level as it gets
without getting platform dependent.
SDL_Mixer is intended to handle sound effects and music. You load
sound effects and songs, and then you play them - no streaming from
external sources. There is an effect API that supports custom
effects “injected” from the application, but there’s no (proper) way
of implementing your own sources; ie synth voices, stream decoders
and such.
OpenAL is similar, but more complex, and is, as I understand it,
primarily designed for 3D positional audio in OpenGL applications -
although it doesn’t depend on OpenGL, and can be used for normal 2D
audio as well, as that’s a subset of 3D audio. It supports streaming,
and should be able to do what you want.
If all you need is play one single stream of audio, I don’t see the
point in going beyond SDL audio, which is already there, and about as
simple as it gets.
BTW, both SDL_Mixer and OpenAL can use SDL audio for output. That is,
anything you can do with those, and much more, can be done with SDL
audio (most things that need audio output, basically) - but
obviously, you’ll have to hack your own low level code, as all SDL
audio does is play back a single, raw, constant rate audio stream.
(An abstract interface for a normal sound card, that is.)
//David Olofson - Programmer, Composer, Open Source Advocate
.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Friday 01 June 2007, Kostas Kostiadis wrote:
Hm…I think I need to have a think about where I’m going in the
audio department
Has anyone already looked into SDL_Mixer vs SDL_Audio vs OpenAL?
Is so, what are the pros/cons of using each one?