Package toxi.audio
Class MultiTimbralManager
java.lang.Object
toxi.audio.MultiTimbralManager
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
debug()
Uses the class' logger to print out status information about the current usage of the managed audio sources.Attempts to find an available, currently unusedAudioSource
instance which can then be configured and played by the client application.boolean[]
getUsage()
Produces an array of status flags of used voices.
-
Constructor Details
-
MultiTimbralManager
-
-
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
Attempts to find an available, currently unusedAudioSource
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
-