Package tripleplay.sound
Class SoundBoard
java.lang.Object
tripleplay.sound.SoundBoard
Manages sound clips (sfx) and loops (music). Allows for master volume adjustment, and applying
adjusted volume to currently playing loops. The expected usage pattern is to create a separate
sound board for every collection of sounds that share a single volume control. For example, one
might create one board for SFX and one board for music so that each could be volume controlled
(and disabled) separately.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSoundBoard
(Platform plat, react.Signal<Clock> paint) Creates a sound board which will play sounds viaplat
and connect topaint
to receive per-frame updates. -
Method Summary
-
Field Details
-
plat
The platform on which this sound board is operating. -
volume
Controls the volume of this sound board. -
muted
Controls whether this sound board is muted. When muted, no sounds will play.
-
-
Constructor Details
-
SoundBoard
Creates a sound board which will play sounds viaplat
and connect topaint
to receive per-frame updates.
-
-
Method Details
-
getClip
Creates and returns a clip with the supplied path. This clip will contain its own copy of the sound data at the specified path, and thus should be retained by the caller if it will be used multiple times before being released. Once all references to this clip are released, it will be garbage collected and its sound data unloaded. -
getLoop
Creates and returns a loop with the supplied path. The loop will contain its own copy of the sound data at the specified path, and thus should be retained by the caller if it will be used multiple times before being released. Once all references to this loop are released, it will be garbage collected and its sound data unloaded.
-