[SDL] SDL_Mixer and streamed vorbis data
Steve Fink
sphink at gmail.com
Fri Jun 1 10:19:26 PDT 2007
This would make a very good FAQ entry, since I'm going through the
same (painful) process of figuring out what audio libraries to use.
I've been using SDL_mixer up until now for exactly what it's intended
for, but I need to add an audio stream synced to video. I would have
loved to have read this response sooner.
Currently, I'm looking at using gstreamer for all my audio stuff --
but it's the opposite problem from SDL_mixer; it's really *only* set
up for doing the streaming audio, and doesn't handle the uploaded
sound clip model that is more typical for games. I need both, and I'd
prefer using a single library. (Also, if you try to install gstreamer
from RPMs and aren't on the latest possible distribution, you will
spend a week suffering in dependency hell before you give up.)
On 6/1/07, David Olofson <david at olofson.net> wrote:
> 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?
>
> 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 --'
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list