Package toxi.audio

Class MultiTimbralManager

java.lang.Object
toxi.audio.MultiTimbralManager

public class MultiTimbralManager extends Object
Implements a manager to play a number of shared samples in a multitimbral manner without interrupting/restarting the playback of currently playing sources. This is different to the default JOAL way of accessing sources directly. The manager is keeping track of active sources and will attempt to assign free ones for newly requested playbacks. If all voices are active, the oldest one will be stopped and used as the newly requested voice.
  • Constructor Details

    • MultiTimbralManager

      public MultiTimbralManager(JOALUtil liboal, int num)
  • Method Details

    • debug

      public void debug()
      Uses the class' logger to print out status information about the current usage of the managed audio sources.
    • getNextVoice

      public AudioSource getNextVoice()
      Attempts to find an available, currently unused AudioSource instance which can then be configured and played by the client application. If no free source is available the oldest playing one will be stopped and returned as free.
      Returns:
      a free AudioSource instance
    • getUsage

      public boolean[] getUsage()
      Produces an array of status flags of used voices. Elements set to true indicate the voice is currently active/playing.
      Returns:
      boolean array