jeudi 28 mai 2015

Sound Problem

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:
Java Code:

  1.  
  2. public static void playSoundAPI(final String URL , final boolean Replay){
  3. if(PlaySound.getBoolean("!Mute", true)){
  4. new Thread(new Runnable() {
  5.  
  6.  
  7. public void run() {
  8. Mixer.Info[] m = AudioSystem.getMixerInfo();
  9. mix = AudioSystem.getMixer(m[0]);
  10.  
  11.  
  12. DataLine.Info det = new DataLine.Info(Clip.class, null);
  13.  
  14.  
  15. try{clip = (Clip)mix.getLine(det);}
  16. catch(LineUnavailableException ex){ ex.printStackTrace(); }
  17.  
  18.  
  19. try{
  20. AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResourceAsStream(URL));
  21.  
  22.  
  23. clip = AudioSystem.getClip();
  24. clip.open(inputStream);
  25.  
  26.  
  27. System.out.println(URL);
  28. System.out.printf(mix.getMixerInfo().getDescription() + "%n");
  29. System.out.println(clip.getMicrosecondLength() + "micSek");
  30. }
  31. catch(LineUnavailableException e){e.printStackTrace();}
  32. catch(IOException e){e.printStackTrace();System.out.println("it locks like the file is not found");}
  33. catch(UnsupportedAudioFileException e){System.out.println("it locks like the Sound has an incorect format");}
  34.  
  35. clip.start();
  36.  
  37.  
  38. while(true){
  39. if(clip.getMicrosecondLength() == clip.getMicrosecondPosition()){
  40. clip.stop();
  41. if(Replay){run();
  42. }else{
  43. Thread.yield();}}
  44.  
  45. }}}
  46. ).start();
  47. }
  48. }


Sound Problem

0 commentaires:

Enregistrer un commentaire