Class AudioController


  • public class AudioController
    extends java.lang.Object
    • 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 background
      void setGain_MUSIC​(float gain)
      The the audio volume of the music track
      void setGain_SFX​(float gain)
      The the audio volume of the sfx track
      void setMusicTrack​(java.net.URL file)
      Change the curent backgorund music.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • soundEffetLineVolumeControl

        float soundEffetLineVolumeControl
      • musicLineVolumeControl

        float musicLineVolumeControl
      • bgMusicThread

        java.lang.Thread bgMusicThread
      • sfxThreadPool

        java.util.concurrent.ExecutorService sfxThreadPool
    • Constructor Detail

      • AudioController

        public AudioController()
        Read the configured audio level in the config
    • 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