Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.util.Scanner;
- import javax.media.Manager;
- import javax.media.Player;
- public class songs {
- public static void main(String args[]) throws Exception
- {
- File f = new File("C:\\Users\\Maxime\\Desktop\\testabba.wav");
- Player p;
- p = Manager.createRealizedPlayer(f.toURI().toURL());
- p.start();
- Scanner s = new Scanner(System.in);
- String st = s.nextLine();
- if(st.equals("s"))
- {
- p.stop();
- s.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement