Hallo zusammen
ich hab mal wieder ein(oder immer noch) ein Sound problem
was zur hölle bedeutet
java.io.IOException: mark/reset not supported
IOExeption ist ein algemeines einausgabe problem
aber wie grig ich das mark und reset zeug weg
Problem Code:
ich hab mal wieder ein(oder immer noch) ein Sound problem
was zur hölle bedeutet
java.io.IOException: mark/reset not supported
IOExeption ist ein algemeines einausgabe problem
aber wie grig ich das mark und reset zeug weg
Problem Code:
Java:
public static void playSoundAPI(final String URL , final boolean Replay){
if(PlaySound.getBoolean("!Mute", true)){
new Thread(new Runnable() {
public void run() {
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(getClass().getResourceAsStream(URL));
clip = AudioSystem.getClip();
clip.open(inputStream);
System.out.println(URL);
System.out.printf(mix.getMixerInfo().getDescription() + "%n");
System.out.println(clip.getMicrosecondLength() + "micSek");
}
catch(LineUnavailableException e){e.printStackTrace();}
catch(IOException e){e.printStackTrace();System.out.println("it locks like the file is not found");}
catch(UnsupportedAudioFileException e){System.out.println("it locks like the Sound has an incorect format");}
clip.start();
while(true){
if(clip.getMicrosecondLength() == clip.getMicrosecondPosition()){
clip.stop();
if(Replay){run();
}else{
Thread.yield();}}
}}}
).start();
}
}