2 Replies - 5325 Views - Last Post: 17 January 2013 - 06:59 PM Rate Topic: -----

#1 icemanx7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-January 13

How to play Back ground sound in java gui

Posted 17 January 2013 - 07:26 AM

I am currently designing a GUI in java for a school project. I am finished with the GUI but i would like to insert back ground music on one of my panels. What is a good method to use to get Back ground music. I searched google and found something called AudioInputStream. Is this the only way to play music in java. Also this is not going to be an applet.
Thank you very much.
Is This A Good Question/Topic? 0
  • +

Replies To: How to play Back ground sound in java gui

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10364
  • View blog
  • Posts: 38,362
  • Joined: 27-December 08

Re: How to play Back ground sound in java gui

Posted 17 January 2013 - 01:58 PM

See the Tutoracles on Sound.
Was This Post Helpful? 1
  • +
  • -

#3 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 822
  • View blog
  • Posts: 2,529
  • Joined: 29-July 11

Re: How to play Back ground sound in java gui

Posted 17 January 2013 - 06:59 PM

AudioInputStream audio = AudioSystem.getAudioInputStream(new File("x.wav"));
Clip clip = AudioSystem.getClip();
clip.open(audio);
clip.start();


Was This Post Helpful? 1
  • +
  • -

Page 1 of 1