title: adding sfx on Clip object in java
body: <p>I'm working on a project where I will have one 24-hours long sound clip which has different phases based on local daytime (morning phase has one sound, transition phases, evening phase, etc.)</p>
  
  <p>so here is what i got now, and it's ok </p>
  
  <p>method that plays the clip (turns current local time in microseconds and sets starting point to match current time - if i start program 13:35 it will start playing mid-day phase of sound which is on that position, and it's ok</p>
  
  <pre><code>void playMusic(String musicLocation){
          try{
             File musicPath = new File(musicLocation);
  
             if(musicPath.exists())
             {               
                 Calendar calendar = Calendar.getInstance();
                  //Returns current time in millis
                  long timeMilli2 = calendar.getTimeInMillis();
                   System.out.println("Time in milliseconds using Calendar: " + (timeMilli2 * 1000)) ;
  
  
                 AudioInputStream audioInput  = AudioSystem.getAudioInputStream(musicPath);
  
                 Clip clip = AudioSystem.getClip();
                 clip.open(audioInput);
                 clip.setMicrosecondPosition(12345678);
                 clip.start();
                 clip.loop(Clip.LOOP_CONTINUOUSLY);
  
                 System.out.println(clip.getMicrosecondLength());
  
                 //setFramePosition
                 JOptionPane.showMessageDialog(null, "Press OK to stop playung");
  
             }
             else
             {
                 System.out.println("no file");
             }
          }catch(Exception ex){
              ex.printStackTrace();
          }
      }
  
  </code></pre>
  
  <p>main method that just calls this method </p>
  
  <pre><code>    public static void main(String[] args) {
          String filepath = "src/sounds/test_file.wav";
  
          PyramidMethods pyra = new PyramidMethods();
          pyra.playMusic(filepath);  
      }
  </code></pre>
  
  <p>now this is pretty simple and straightforward, and also what I need, but now what i wonder is the following -> can I and if can, how, add sound effects based on the temperature outside?</p>
  
  <p>so what I was thinking is to open separate thread in main which would regularly check some wheather API and when temperature changes add sound effects like echo, distortion or something else based on temperature change (if it's colder then x it would put echo sound effect on running clip, etc.)</p>
  
  <p>it this even possible in Java? it's my first time using sounds with Java so I am even inexperienced with the search terms here, would someone suggest some other programming language for it?</p>
  
  <p>thanks for your answers in advance.</p>