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.

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: danwgrace@gmail.com (Daniel Grace)
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