Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import java.io.File;
  2. import java.util.Scanner;
  3.  
  4. import javax.media.Manager;
  5. import javax.media.Player;
  6.  
  7.  
  8.  
  9. public class songs {
  10.  
  11. public static void main(String args[]) throws Exception
  12. {
  13. File f = new File("C:\\Users\\Maxime\\Desktop\\testabba.wav");
  14.  
  15. Player p;
  16. p = Manager.createRealizedPlayer(f.toURI().toURL());
  17.  
  18.  
  19. p.start();
  20.  
  21. Scanner s = new Scanner(System.in);
  22.  
  23. String st = s.nextLine();
  24. if(st.equals("s"))
  25. {
  26. p.stop();
  27. s.close();
  28. }
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement