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.Thread
bgMusicThread
(package private) float
musicLineVolumeControl
(package private) java.util.concurrent.ExecutorService
sfxThreadPool
(package private) float
soundEffetLineVolumeControl
-
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 void
playSFX(java.net.URL file)
Play an audio effect in the backgroundvoid
setGain_MUSIC(float gain)
The the audio volume of the music trackvoid
setGain_SFX(float gain)
The the audio volume of the sfx trackvoid
setMusicTrack(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
-
-