Package ch.epfl.cs107.play.engine.actor
Class SoundAcoustics
java.lang.Object
ch.epfl.cs107.play.engine.actor.SoundAcoustics
- All Implemented Interfaces:
Acoustics
-
Constructor Summary
ConstructorsConstructorDescriptionSoundAcoustics(String name) Alternative sound Acoustics constructorSoundAcoustics(String name, float volume, boolean fadeIn, boolean randomFirstStart, boolean loop, boolean stopOthersOnStart) Default sound Acoustics constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidPlay itself on specified Audio context.voidSet the "should be started" flag to truestatic voidstopAllSounds(Audio audio) Stop all sounds from given audio context by sending a null sound that stop others on starts
-
Constructor Details
-
SoundAcoustics
public SoundAcoustics(String name, float volume, boolean fadeIn, boolean randomFirstStart, boolean loop, boolean stopOthersOnStart) Default sound Acoustics constructor- Parameters:
name- (String): name of the sound without path and extension. May be bullvolume- (float): 0.0f no sound, 1.0f full audiofadeIn- (boolean): indicate if the song fade in until reaching its max volumerandomFirstStart- (boolean): indicate if the first start is random in the soundloop- (boolean): indicate if the sound must loop on self endingstopOthersOnStart- (boolean): indicate if all other sound are stopped on given sound's start
-
SoundAcoustics
Alternative sound Acoustics constructor- Parameters:
name- (String): name of the sound without path and extension. May be null
-
-
Method Details
-
shouldBeStarted
public void shouldBeStarted()Set the "should be started" flag to true -
bip
Description copied from interface:AcousticsPlay itself on specified Audio context. -
stopAllSounds
Stop all sounds from given audio context by sending a null sound that stop others on starts- Parameters:
audio- (Audio): given audio context. Not null
-