[SDL] How to manage channels

Edward Byard e_byard at yahoo.co.uk
Mon Mar 24 12:25:24 PDT 2008


Hi Daniel

Depends on what you are doing, and how important sounds are.

If you have many channels then fine, just get an empty channel and play your sound.
Personally I reserve a channel for looping sounds, and then just use others for effects, but again it depends on your needs.

I think it's better to manage your channel usage rather than just randomly kill channels when you need to play another sound.

Ed



----- Original Message ----
From: Daniel Grace <danwgrace at gmail.com>
To: SDL at lists.libsdl.org
Sent: Monday, 24 March, 2008 6:10:31 PM
Subject: [SDL] How to manage channels

When using Mix_PlayChannel to play effects is the best way to look for
a free channel (a channel not already playing something) , and play
the effect on the free channel ?  If there is no free channel then
either don't play the effect or stop one of the channels and play the
new effect instead.
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






      __________________________________________________________
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080324/f2ece1e5/attachment.htm 


More information about the SDL mailing list