Controlling Multi-channel Sound

Do you know that Macromedia Flash only suppport maximum 8 channel sounds? For instance, if your current sound channel reachs maximum limit, Flash cannot play new sound unless one of the play sound ends. So, I made SoundController class, which manages sound channel. When current channel get to maximum sound limit, SoundController class stop the oldest sound, thus you can play the new sound. The mechanism of this class is similar to “Queue” structure. When you add a new sound, the oldest sound pops.

Here is a structure of the class:

  1. soundcontroller.maxSound : Limit of flash. Fixed value. Default is 8.
  2. soundcontroller.BindInst : Interface with instrument.
  3. soundcontroller.soundQueue : Queue structured Array. Playing sounds are stored in this array.
  4. soundcontroller.Play(soundID) : Play a sound. And manage sound queue automatically.

Here is the full source:

Leave a Reply

You must be logged in to post a comment.