# Sound Engin Problem 2



## MrTroble (14. Mai 2015)

Hallo,
irgend wie funktioniert meine Sound Engin nicht mehr


```
public static void playSoundAPI(final String URL , final boolean Replay){	 
        if(PlaySound.getBoolean("!Mute", true)){
	 new Thread(new Runnable() {


                @Override
                @SuppressWarnings("CallToPrintStackTrace")
		public void run() {
    Mixer mix;
    Clip clip;
    Mixer.Info[] m = AudioSystem.getMixerInfo();
    mix = AudioSystem.getMixer(m[0]);
    DataLine.Info det = new DataLine.Info(Clip.class, null);
    try{clip = (Clip)mix.getLine(det);}catch(LineUnavailableException ex){ ex.printStackTrace(); }
    try{
   		 AudioInputStream inputStream = AudioSystem.getAudioInputStream(Launchermain.class.getResourceAsStream(URL));
   		clip = AudioSystem.getClip();
   	        clip.open(inputStream);
                clip.start();
   	        Logger.Info(URL);
   	        Logger.Info(mix.getMixerInfo().getDescription());
   	        Logger.Info(clip.getMicrosecondLength() + "micSek");
             
    while(true){
    if(clip.getMicrosecondPosition() == clip.getMicrosecondLength()){
   	 clip.stop();
   	if(Replay){run();}else{Thread.interrupted();}}
		}
	
    }catch(LineUnavailableException | IOException | UnsupportedAudioFileException e){e.printStackTrace();}
         }}).start();
    }
}
```

die Fehler meldung

java.io.IOException: mark/reset not supported
	at java.util.zip.InflaterInputStream.reset(InflaterInputStream.java:286)
	at java.io.FilterInputStream.reset(FilterInputStream.java:226)
	at com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(SoftMidiAudioFileReader.java:139)
	at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1113)
	at MrTroble.Blackout.Sound$1.run(Sound.java:39)
	at java.lang.Thread.run(Thread.java:745)


----------



## Sogomn (18. Mai 2015)

Könntest du den Code vorher formatieren? Das ist Gift für meine Augen.


----------



## MrTroble (21. Mai 2015)

Sorry so ist der formatiert du willst mein Code garnicht erst sehen :lol:


----------

