Package fr.iut.tetris.controllers
Class AudioController
- java.lang.Object
-
- fr.iut.tetris.controllers.AudioController
-
public class AudioController extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.ThreadbgMusicThread(package private) floatmusicLineVolumeControl(package private) java.util.concurrent.ExecutorServicesfxThreadPool(package private) floatsoundEffetLineVolumeControl
-
Constructor Summary
Constructors Constructor Description AudioController()Read the configured audio level in the config
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidplaySFX(java.net.URL file)Play an audio effect in the backgroundvoidsetGain_MUSIC(float gain)The the audio volume of the music trackvoidsetGain_SFX(float gain)The the audio volume of the sfx trackvoidsetMusicTrack(java.net.URL file)Change the curent backgorund music.
-
-
-
Method Detail
-
playSFX
public void playSFX(java.net.URL file)
Play an audio effect in the background- Parameters:
file- path of the audio file
-
setMusicTrack
public void setMusicTrack(java.net.URL file)
Change the curent backgorund music. If there is no music the music will start- Parameters:
file- path of the audio file
-
setGain_SFX
public void setGain_SFX(float gain)
The the audio volume of the sfx track- Parameters:
gain- the gain min:-80 max6
-
setGain_MUSIC
public void setGain_MUSIC(float gain)
The the audio volume of the music track- Parameters:
gain- the gain min:-80 max6
-
-