[SDL] SDL_mixer question

Kostas Kostiadis kos at climaxgroup.com
Fri Jan 5 02:28:28 PST 2007


Cool...thx for the replies Peter and Ryan!

I'm guessing the same principle of "don't adjust the volume while fading is
in progress" applies to both chunk/channel stuff and music, right? 


Cheers,
Kos

-----Original Message-----
From: sdl-bounces+kos=climaxgroup.com at libsdl.org
[mailto:sdl-bounces+kos=climaxgroup.com at libsdl.org] On Behalf Of Ryan C.
Gordon
Sent: 05 January 2007 01:39
To: A list for developers using the SDL library. (includes SDL-announce)
Subject: Re: [SDL] SDL_mixer question


> Q1)
> Does that mean I can only have 1 "music" playing at any one time?

Yes.

If I had a time machine, I'd go back and beg someone to call this 
'channel' something other than "music" ... maybe "streamed".

> Assuming I have my background music playing...say I need to play some 
> SFX at the same time...
> Is this done using the Mix_LoadWAV and then the Channel family of 
> functions (i.e. Mix_AllocateChannels, Mix_PlayChannel, etc.)?

Yes. The other channels are things that can be trivially decoded into an 
uncompressed PCM waveform all at once, like a small .wav file for a 
gunshot sound.

> I'm guessing to start off with I don't need to worry about effects, right?
> I can just use the build-in processors for now (if needed).

Effects can be totally avoided unless you want to do something hardcore 
and complex...they require you not only to operate on the waveform 
directly, but handle every strange case of data format and channel count 
and frequency. Avoid this API unless you have a desperate need and 
really know what you're doing at a lowlevel.

There are a few built-in effects that might be useful to you, and almost 
everything else you need is just mixing some explosions with a 
soundtrack as you go (which can be done with the basic SDL_mixer APIs, 
completely ignoring the effects stuff).

--ryan.


_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list