Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. URL url = new URL("https://");
  2. url.openConnection();
  3.  
  4. import java.applet.Applet;
  5. import java.applet.AudioClip;
  6. import java.net.URL;
  7.  
  8. public class MainClass {
  9. public static void main(String[] args) {
  10. try {
  11. URL url = new URL("file:youraudiofile.wav" );
  12. AudioClip ac = Applet.newAudioClip(url);
  13. ac.play();
  14.  
  15. System.out.println("Press any key to exit.");
  16. System.in.read();
  17. ac.stop();
  18. } catch (Exception e) {
  19. System.out.println(e);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement