2010-12-09 5 views

Répondre

1

vous pouvez l'utiliser pour jouer un .mp3 ou .wav

Player p; 
InputStream is = getClass().getResourceAsStream(SoundName[sound]); 
     try { 
      p = Manager.createPlayer(is, "audio/X-wav"); 
      p.start(); 
      is.close(); 
      is = null; 
     } catch (IOException ex) { 
      ex.printStackTrace(); 
     } catch (MediaException ex) { 
      ex.printStackTrace(); 
     } 

p.setLoopCount(100);//using this you can play the sound in loop